/* ---------- Tokens ---------- */
:root {
  --bg: #F3EEE3;
  --ink: #1E1B17;
  --body: #2E2A24;
  --muted: #5F584E;
  --faint: #C9C0AF;
  --line: #CFC6B5;
  --line-soft: #D6CDBD;
  --seal: #A8321C;
  --on-seal: #F6F0E4;
  --enso: 0.07;

  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --mincho: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --sans: 'Zen Kaku Gothic New', system-ui, sans-serif;

  --gutter: 64px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14130F;
    --ink: #ECE6D8;
    --body: #D8D1C3;
    --muted: #A59D8F;
    --faint: #4A453C;
    --line: #3A362E;
    --line-soft: #3A362E;
    --seal: #B8402A;
    --enso: 0.09;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.35; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 4px; }
@media (hover: hover) {
  a:hover { opacity: 0.7; }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.seal {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--seal);
  color: var(--on-seal);
  font-family: var(--mincho);
  font-weight: 500;
  line-height: 1;
  border-radius: 2px;
}

.enso { fill: none; stroke: var(--ink); stroke-linecap: round; }

.kicker {
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.poem {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 36px var(--gutter);
  position: relative;
  z-index: 1;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .seal { width: 30px; height: 30px; font-size: 17px; border-radius: 3px; }
.brand-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.site-nav { display: flex; gap: 40px; font-size: 14px; letter-spacing: 0.14em; }
.site-nav a {
  padding: 12px 0;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Pill buttons ---------- */
.pill {
  height: 48px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.pill--solid { padding: 0 26px; background: var(--ink); border-color: var(--ink); color: var(--bg); }
.round-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  color: var(--ink);
}

/* ---------- Aujourd'hui ---------- */
.today {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px var(--gutter);
}
.today .enso-bg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 640px;
  height: 640px;
  transform: translate(-50%, -51.5%);
  opacity: var(--enso);
  pointer-events: none;
}
.today .vertical {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--mincho);
  font-size: 18px;
  letter-spacing: 0.6em;
  color: var(--faint);
}
.today article { position: relative; display: flex; flex-direction: column; gap: 32px; }
.today .poem { font-size: clamp(32px, 4.7vw, 68px); line-height: 1.32; }
.signature { display: flex; align-items: center; gap: 18px; }
.signature .rule { width: 40px; height: 1px; background: var(--muted); }
.signature time { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted); }
.signature .seal { width: 34px; height: 34px; font-size: 19px; }

.today-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  padding: 28px var(--gutter) 40px;
  position: relative;
  z-index: 1;
}
.today-footer .pos { font-size: 13px; letter-spacing: 0.14em; color: var(--muted); }
.today-footer .controls { display: flex; justify-content: center; gap: 12px; }
.today-footer .end { display: flex; justify-content: flex-end; }
.text-btn {
  height: 44px;
  padding: 0 4px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.14em;
}
.only-mobile { display: none; }

/* ---------- Calendrier ---------- */
.calendar {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 96px;
  padding: 24px 120px 56px;
}
.cal-month { display: flex; flex-direction: column; gap: 28px; }
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal-head h1 {
  order: -1;
  margin: 0 auto 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 44px;
  letter-spacing: 0.01em;
}
.weekdays, .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.weekdays {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.weekdays abbr { text-decoration: none; }
.weekdays .short { display: none; }
.cell { height: 64px; display: flex; align-items: center; justify-content: center; }
.day {
  width: 56px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: 1.5px solid var(--line-soft);
  border-radius: 28px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}
.day .dot { width: 5px; height: 5px; border-radius: 3px; background: var(--seal); }
.day[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.day[aria-pressed="true"] .dot { background: var(--bg); }
.day-plain {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}
.day-plain.is-today { border-bottom-color: var(--seal); }

.year-strip {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.year-strip .meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.months button {
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.06em;
}
.months button.has-haiku { color: var(--ink); }
.months button[aria-current="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.cal-reading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding-left: 72px;
  border-left: 1px solid var(--line-soft);
}
.cal-reading .when { display: flex; align-items: center; gap: 14px; }
.cal-reading .seal { width: 28px; height: 28px; font-size: 16px; }
.cal-reading time { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted); }
.cal-reading .poem { font-size: clamp(26px, 3.05vw, 44px); line-height: 1.34; }
.read-link {
  align-self: flex-start;
  padding: 12px 0;
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}

/* ---------- À propos ---------- */
.about {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 64px;
  padding: 0 120px 64px;
}
.about-art {
  position: relative;
  height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-art svg { position: absolute; width: 520px; height: 520px; max-width: 100%; }
.about-art .glyph { font-family: var(--mincho); font-weight: 500; font-size: 150px; line-height: 1; }
.about-art .seal { position: absolute; right: 84px; bottom: 96px; width: 44px; height: 44px; font-size: 24px; }
.about article { display: flex; flex-direction: column; gap: 28px; max-width: 540px; }
.about h1 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 56px; line-height: 1.1; }
.about p { margin: 0; font-size: 17px; line-height: 1.75; color: var(--body); }
.about p a { border-bottom: 1px solid var(--line-soft); }
.facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}
.facts div { display: flex; flex-direction: column; gap: 6px; }
.facts dt { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-family: var(--serif); font-size: 22px; }
.facts a { border-bottom: 1px solid var(--line-soft); }

/* ---------- Medium screens ---------- */
@media (max-width: 1180px) {
  .today .vertical { display: none; }
  .calendar { gap: 56px; padding: 24px var(--gutter) 56px; }
  .cal-reading { padding-left: 48px; }
  .day { width: 48px; height: 48px; }
  .about { padding: 0 var(--gutter) 64px; }
  .about-art { height: 440px; }
  .about-art svg { width: 420px; height: 420px; }
  .about-art .glyph { font-size: 120px; }
  .about-art .seal { right: 24px; bottom: 56px; }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  :root { --gutter: 24px; }

  .site-header { padding: 20px 24px; }
  .brand { width: 44px; height: 44px; }
  .brand-name {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .site-nav { gap: 20px; font-size: 13px; letter-spacing: 0.1em; }

  .kicker { font-size: 12px; letter-spacing: 0.22em; }

  /* Aujourd'hui */
  .today { justify-content: flex-start; padding: 0 32px; }
  .today .enso-bg { width: min(380px, 100vw); height: min(380px, 100vw); }
  .today article { gap: 24px; }
  .today .poem { font-size: clamp(26px, 8.5vw, 32px); line-height: 1.34; }
  .signature { gap: 14px; }
  .signature .rule { display: none; }
  .signature .seal { order: -1; width: 28px; height: 28px; font-size: 16px; }
  .signature time { font-size: 19px; }

  .today-footer { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 16px 24px 32px; }
  .today-footer .controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; }
  .today-footer .pos { order: 2; text-align: center; font-size: 12px; }
  .today-footer .end { display: none; }
  .today-footer .pill { height: 52px; border-radius: 26px; padding: 0; }
  .today-footer .pill--solid { gap: 8px; letter-spacing: 0.08em; }
  .today-footer .arrow { font-size: 18px; letter-spacing: 0; }
  .only-desktop { display: none; }
  .only-mobile { display: inline; }

  /* Calendrier */
  .calendar { display: flex; flex-direction: column; gap: 8px; padding: 8px 24px 32px; }
  .cal-month { gap: 16px; }
  .cal-head { justify-content: space-between; }
  .cal-head h1 { order: 0; margin: 0; font-size: 30px; }
  .weekdays { gap: 0; font-size: 11px; letter-spacing: 0.12em; }
  .weekdays .long { display: none; }
  .weekdays .short { display: inline; }
  .days { gap: 2px 0; }
  .cell { height: 48px; }
  .day { width: 44px; height: 44px; gap: 3px; border-radius: 22px; font-size: 19px; }
  .day .dot { width: 4px; height: 4px; border-radius: 2px; }
  .day-plain { font-size: 18px; }
  .year-strip { display: none; }
  .cal-reading {
    justify-content: flex-start;
    gap: 14px;
    padding: 22px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }
  .cal-reading .seal { display: none; }
  .cal-reading time { font-size: 18px; }
  .cal-reading .poem { font-size: 26px; }
  .read-link { font-size: 13px; letter-spacing: 0.12em; }

  /* À propos */
  .about { display: flex; flex-direction: column; align-items: stretch; gap: 22px; padding: 8px 32px 32px; }
  .about-art { height: 180px; }
  .about-art svg { width: 180px; height: 180px; }
  .about-art .glyph { font-size: 56px; }
  .about-art .seal { display: none; }
  .about article { gap: 22px; }
  .about h1 { font-size: 38px; }
  .about p { font-size: 16px; line-height: 1.7; }
  .facts { display: flex; flex-direction: column; gap: 16px; padding-top: 20px; }
  .facts div { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 12px; }
  .facts dd { font-size: 20px; text-align: right; }
}

/* ---------- Small phones (iPhone SE, 320px) ---------- */
@media (max-width: 360px) {
  .site-nav { gap: 14px; letter-spacing: 0.06em; }
}
