/* -------------------------------------------------------------------
   NIMINI STUDIO — a single quiet task at a time.
   Milk-white background, near-black typography, hairline dividers,
   no gradients, no shadows, no colored circles, no bright accents,
   no third-party calendar/datepicker components.
   ------------------------------------------------------------------- */

:root {
  --bg: #F6F2EA;
  --ink: #17140F;
  --ink-soft: #4B453D;
  --muted: #8C8377;
  --muted-light: #D9D3C6;
  --line: #DCD3C4;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;

  --max-width: 640px;

  /* calm, slow, Apple-like deceleration */
  --ease-slow: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-slow: 0.7s;
  --dur-medium: 0.4s;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: env(safe-area-inset-top, 0) var(--space-3) calc(env(safe-area-inset-bottom, 0) + var(--space-5));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- hero ---------- */

.hero {
  text-align: center;
  padding: var(--space-5) 0 var(--space-4);
}

.logo {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.logo-main {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: 0.14em;
  font-weight: 400;
}

.logo-sub {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--ink-soft);
  padding-left: 0.42em; /* optical compensation for letter-spacing */
}

.tagline {
  margin: var(--space-2) 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

/* ---------- generic section ---------- */

.content {
  flex: 1;
}

.section {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--line);
}

.section-title {
  margin: 0 0 var(--space-4);
  text-align: center;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: 0.01em;
}

.section-title-sm {
  margin: 0 0 var(--space-2);
  text-align: center;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.01em;
}

/* ---------- calendar ---------- */

.calendar {
  max-width: 380px;
  margin: 0 auto;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: var(--space-3);
}

.month-arrow {
  appearance: none;
  background: none;
  border: none;
  padding: 6px 12px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.2s ease;
}

.month-arrow:disabled {
  color: var(--muted-light);
  cursor: default;
}

.month-label {
  margin: 0;
  min-width: 140px;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
}

.calendar-weekdays span {
  display: block;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.calendar-body {
  transition: opacity var(--dur-medium) var(--ease-slow);
}

.calendar-body.is-transitioning {
  opacity: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
}

.day {
  appearance: none;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  width: 100%;
  max-width: 44px;
  aspect-ratio: 1;
  margin: 3px auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.3s ease;
}

span.day {
  cursor: default;
}

.day-muted {
  color: var(--muted-light);
}

.day-empty {
  visibility: hidden;
}

.day.is-today,
.day.is-selected {
  border-color: var(--ink);
}

.empty-note {
  margin: var(--space-3) 0 0;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.empty-note a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}

/* ---------- available time ---------- */

.times-section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-slow), transform var(--dur-slow) var(--ease-slow);
}

.times-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.times {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 380px;
  margin: 0 auto;
}

.time-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 1px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  height: 54px;
  width: 100%;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

.time-btn:hover {
  border-color: var(--ink);
}

.time-btn[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* ---------- CTA ---------- */

.cta-section {
  padding: var(--space-4) 0 var(--space-3);
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-slow), transform var(--dur-slow) var(--ease-slow);
}

.cta-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.selection-label {
  margin: 0 0 2px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.selection-date {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
}

.selection-time {
  margin: 0 0 var(--space-3);
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
}

.btn-primary {
  appearance: none;
  width: 100%;
  max-width: 380px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: 0.04em;
  padding: 17px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-primary:active {
  opacity: 0.75;
}

.cta-note {
  margin: var(--space-2) 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.cta-address {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.toast {
  margin: var(--space-2) 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.toast.visible {
  opacity: 1;
}

/* ---------- appear animation (initial load) ---------- */

[data-animate] {
  opacity: 0;
  transform: translateY(8px);
  animation: nimini-fade-in 0.8s var(--ease-slow) forwards;
}

.hero { animation-delay: 0s; }
.content .section:nth-of-type(1) { animation-delay: 0.08s; }

@keyframes nimini-fade-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    animation: none;
    opacity: 1;
    transform: none;
  }
  * {
    transition: none !important;
  }
}

/* ---------- small screens fine-tuning ---------- */

@media (max-width: 360px) {
  .logo-main { font-size: 29px; }
  .day { font-size: 14px; }
}

/* ---------- accessible tap targets ---------- */

.time-btn, .btn-primary, .month-arrow {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
