/* ============================================================
   Quiet Luxe — Editorial Minimalist personal-site template
   School: Aesop / Kinfolk. Calm, paper-warm, serif-led, generous
   whitespace. All visual values are tokens; see design.md.
   ============================================================ */

:root {
  /* ---- palette (warm paper + ink + one muted olive accent) ---- */
  --paper:      oklch(0.949 0.017 78);   /* #F4EFE6  page background      */
  --paper-2:    oklch(0.912 0.020 78);   /* #EAE3D6  raised panels / rules */
  --paper-3:    oklch(0.878 0.023 76);   /* #E0D6C4  deeper wash          */
  --ink:        oklch(0.235 0.014 62);   /* #211C15  primary text         */
  --ink-soft:   oklch(0.435 0.017 66);   /* #5B5347  secondary text       */
  --faint:      oklch(0.585 0.018 70);   /* #8A8072  meta / captions      */
  --line:       oklch(0.838 0.020 74);   /* #D8CFBF  hairline borders     */
  --accent:     oklch(0.505 0.058 118);  /* #6B6A43  muted olive          */
  --accent-deep:oklch(0.395 0.055 118);  /* #4F4E30  hover                */

  /* ---- type ---- */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Public Sans", ui-sans-serif, system-ui, sans-serif;

  /* ---- rhythm ---- */
  --pad:      clamp(22px, 5vw, 64px);
  --section:  clamp(64px, 12vh, 156px);
  --measure:  62ch;
  --radius:   2px;
  --ease:     cubic-bezier(0.22, 0.61, 0.36, 1);
}

*{ box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--paper); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--pad); }
.measure { max-width: var(--measure); }

/* eyebrow / mono-ish label — small caps, wide tracking */
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------------------------------------------------------------
   Nav
   --------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 20px var(--pad);
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav .brand {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.nav .brand em { font-style: italic; color: var(--accent); }
.nav .links { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 34px); }
.nav .links a {
  font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--ink-soft); position: relative; padding: 4px 0;
  transition: color 0.25s var(--ease);
}
.nav .links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.nav .links a:hover { color: var(--ink); }
.nav .links a:hover::after,
.nav .links a[aria-current="page"]::after { transform: scaleX(1); }
.nav .links a[aria-current="page"] { color: var(--ink); }

/* language toggle */
.lang {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.lang button {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em;
  padding: 6px 11px; background: transparent; color: var(--faint);
  border: 0; cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.lang button + button { border-left: 1px solid var(--line); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* mobile nav collapse */
@media (max-width: 680px) {
  .nav { flex-wrap: wrap; gap: 14px; }
  .nav .links { order: 3; width: 100%; justify-content: space-between; gap: 12px;
    border-top: 1px solid var(--line); padding-top: 12px; }
  .nav .links a { font-size: 13px; }
}

/* ---------------------------------------------------------------
   Buttons / links
   --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  letter-spacing: 0.02em;
  padding: 13px 22px; border-radius: var(--radius);
  border: 1px solid var(--ink); color: var(--ink);
  background: transparent; cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.textlink {
  color: var(--accent); font-weight: 600;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  transition: border-color 0.2s var(--ease);
}
.textlink:hover { border-color: var(--accent); }

/* ---------------------------------------------------------------
   Hero (home)
   --------------------------------------------------------------- */
.hero { padding: clamp(56px, 11vh, 132px) 0 var(--section); }
.hero .eyebrow { margin-bottom: 26px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 8.4vw, 104px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: 30px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede {
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 54ch;
  margin-bottom: 40px;
}
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------------------------------------------------------------
   Generic section
   --------------------------------------------------------------- */
.section { padding: var(--section) 0; border-top: 1px solid var(--line); }
.section-head { margin-bottom: clamp(34px, 5vw, 60px); }
.section-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 4.6vw, 52px); line-height: 1.08;
  letter-spacing: -0.015em; color: var(--ink); text-wrap: balance;
}
.section-head h2 em { font-style: italic; color: var(--accent); }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head p { color: var(--ink-soft); max-width: var(--measure); margin-top: 16px; }

/* two-column editorial grid */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (max-width: 780px) { .split { grid-template-columns: 1fr; gap: 34px; } }

/* about facts list */
.facts { list-style: none; }
.facts li {
  display: grid; grid-template-columns: 120px 1fr; gap: 20px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.facts li .k { color: var(--faint); font-weight: 600; letter-spacing: 0.04em; font-size: 13px; text-transform: uppercase; padding-top: 3px; }
.facts li .v { color: var(--ink); }

.prose p { color: var(--ink-soft); margin-bottom: 20px; max-width: var(--measure); }
.prose p:last-child { margin-bottom: 0; }
.prose .big-serif { font-family: var(--serif); font-size: clamp(21px, 2.6vw, 27px); line-height: 1.5; color: var(--ink); font-weight: 400; }

/* ---------------------------------------------------------------
   Blog list — editorial rows
   --------------------------------------------------------------- */
.posts { list-style: none; border-top: 1px solid var(--line); }
.post {
  display: grid; grid-template-columns: 150px 1fr auto; gap: clamp(18px, 4vw, 56px);
  align-items: baseline;
  padding: clamp(26px, 4vw, 40px) 0; border-bottom: 1px solid var(--line);
  transition: background 0.3s var(--ease);
}
.post:hover { background: var(--paper-2); }
.post .date { font-size: 13px; color: var(--faint); font-weight: 600; letter-spacing: 0.04em; padding-top: 8px; }
.post .body h3 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(22px, 3vw, 32px); line-height: 1.15; letter-spacing: -0.01em;
  color: var(--ink); margin-bottom: 10px; transition: color 0.2s var(--ease);
}
.post:hover .body h3 { color: var(--accent-deep); }
.post .body p { color: var(--ink-soft); max-width: 60ch; margin-bottom: 14px; }
.post .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--ink-soft); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: var(--radius);
}
.post .read { font-size: 13px; color: var(--faint); white-space: nowrap; padding-top: 8px; }
@media (max-width: 720px) {
  .post { grid-template-columns: 1fr; gap: 10px; }
  .post .date, .post .read { padding-top: 0; }
}

/* ---------------------------------------------------------------
   Contact
   --------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; gap: 44px; } }

.field { margin-bottom: 22px; }
.field label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 9px;
}
.field input, .field textarea {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 10px 0; transition: border-color 0.25s var(--ease);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 120px; }

.contact-side .facts li { grid-template-columns: 90px 1fr; }
.avail {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 600; color: var(--accent-deep);
  margin-bottom: 22px;
}
.avail .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------------------------------------------------------------
   AI page — quiet chat surface
   --------------------------------------------------------------- */
.ai-lead { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 820px) { .ai-lead { grid-template-columns: 1fr; gap: 32px; } }

.chat {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2); overflow: hidden;
  display: flex; flex-direction: column; min-height: 440px;
}
.chat .chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-soft);
}
.chat .chat-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.chat .log { flex: 1; padding: 20px 18px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.msg { max-width: 82%; }
.msg .who { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
.msg .bubble {
  font-size: 15px; line-height: 1.6; color: var(--ink);
  padding: 12px 15px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--paper);
}
.msg.user { align-self: flex-end; text-align: right; }
.msg.user .bubble { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.msg.ai .bubble .big-serif,
.msg.ai .bubble em { font-family: var(--serif); font-style: italic; color: var(--accent-deep); }

.chat .composer { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: var(--paper); }
.chat .composer input {
  flex: 1; font-family: var(--sans); font-size: 15px; color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px;
  transition: border-color 0.2s var(--ease);
}
.chat .composer input:focus { outline: none; border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.chip {
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 13px; background: transparent; cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--ink); }

.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 3vw, 32px); }
@media (max-width: 760px) { .cap-grid { grid-template-columns: 1fr; } }
.cap h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin-bottom: 8px; color: var(--ink); }
.cap p { color: var(--ink-soft); font-size: 15px; }
.cap .num { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--accent); margin-bottom: 12px; display: block; }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding: clamp(44px, 7vw, 80px) 0; }
.footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: end; }
.footer .big {
  font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: clamp(26px, 4vw, 44px); line-height: 1.1; color: var(--ink); letter-spacing: -0.01em;
}
.footer .meta { font-size: 13px; color: var(--faint); }
.footer .social { display: flex; gap: 20px; margin-top: 10px; }
.footer .social a { font-size: 14px; font-weight: 600; color: var(--ink-soft); transition: color 0.2s var(--ease); }
.footer .social a:hover { color: var(--accent); }

/* template ribbon — signals this is a starter, not real data */
.tpl-note {
  font-size: 12px; color: var(--faint); font-style: italic;
  border-top: 1px dashed var(--line); margin-top: 40px; padding-top: 16px;
}

/* ---------------------------------------------------------------
   Entrance motion
   Guarded by html.js so content stays fully visible if JS is absent
   or fails — critical for a template people will edit.
   --------------------------------------------------------------- */
html.js [data-rise] { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
html.js [data-rise].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  html.js [data-rise] { opacity: 1; transform: none; transition: none; }
  .btn .arrow, .nav .links a::after { transition: none; }
}
