/* assets/site.css — shared styles for project detail / contact / 404 pages.
   index.html keeps its inline styles for direct-edit friendliness. */

:root {
  --paper: #f4efe6;
  --paper-2: #ece5d6;
  --paper-3: #e1d8c4;
  --ink: #1c1a17;
  --ink-2: #3b362e;
  --muted: #75695a;
  --line: #1c1a17;
  --line-soft: rgba(28,26,23,0.16);
  --accent: #c4451c;
  --accent-2: #2b6a4a;
  --highlight: #ffe27a;

  --display: 'Fraunces', 'Times New Roman', serif;
  --body:    'Inter', system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  --pad-x: 56px;
  --measure: 680px;
}
html[data-theme="dark"] {
  --paper:   #15140f;
  --paper-2: #1c1a14;
  --paper-3: #221f17;
  --ink:     #f1ebdd;
  --ink-2:   #d5cdbb;
  --muted:   #8a8170;
  --line:    #f1ebdd;
  --line-soft: rgba(241,235,221,0.14);
  --accent:  #e87a4f;
  --accent-2:#7ec79e;
  --highlight: #5a4615;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
body {
  background-image:
    radial-gradient(circle at 18% 22%, rgba(0,0,0,.025) 0, transparent 55%),
    radial-gradient(circle at 82% 78%, rgba(0,0,0,.022) 0, transparent 50%);
}
html[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,.018) 0, transparent 55%),
    radial-gradient(circle at 82% 78%, rgba(255,255,255,.015) 0, transparent 50%);
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; }
p { margin: 0; }
img { max-width: 100%; display: block; }

/* ───── top nav (used on all sub-pages) ───── */
.topnav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in oklch, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 13px;
}
.topnav .crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.topnav .crumb a { color: var(--ink); }
.topnav .crumb a:hover { color: var(--accent); }
.topnav .crumb .sep { color: var(--muted); }
.topnav .right { display: flex; align-items: center; gap: 18px; }
.topnav .right a { color: var(--ink); border-bottom: 1px solid transparent; padding: 2px 0; transition: border-color .15s, color .15s; }
.topnav .right a:hover { border-color: var(--ink); }
.topnav .right a.accent { color: var(--accent); }
.topnav .right a.accent:hover { border-color: var(--accent); }

.theme-toggle {
  border: 1px solid var(--line-soft);
  background: transparent;
  width: 32px; height: 32px;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--paper-2); border-color: var(--line); }

/* ───── page chrome ───── */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px var(--pad-x) 96px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* ───── case study (project detail page) ───── */
.case-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 32px;
}
.case-head h1 {
  font-size: 76px;
  line-height: 0.95;
  letter-spacing: -0.035em;
  max-width: 12ch;
}
.case-head .lead {
  font-size: 20px;
  line-height: 1.45;
  color: var(--ink-2);
  max-width: var(--measure);
  text-wrap: pretty;
}
.case-meta {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.case-meta .kv b { color: var(--ink); font-weight: 500; margin-right: 6px; }
.case-meta .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}

.hero-img {
  margin: 32px 0 48px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-3);
  box-shadow: 0 1px 0 var(--line-soft);
}
.hero-img img { width: 100%; height: auto; display: block; }
.hero-img.dark { background: #0e0c08; }

/* two-column scroll: sticky TOC + content */
.case-body {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 48px;
  align-items: start;
}
.toc {
  position: sticky; top: 88px;
  font-family: var(--mono); font-size: 12px;
  display: flex; flex-direction: column; gap: 8px;
  color: var(--muted);
}
.toc .label { color: var(--ink); letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 4px; }
.toc a { color: var(--muted); transition: color .15s; }
.toc a:hover, .toc a.active { color: var(--accent); }

.case-section { margin-bottom: 64px; }
.case-section:last-child { margin-bottom: 0; }
.case-section h2 {
  font-size: 32px;
  line-height: 1.1;
  margin-bottom: 18px;
  display: flex; align-items: baseline; gap: 14px;
}
.case-section h2 .num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.case-section p, .case-section li {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}
.case-section p + p { margin-top: 14px; }
.case-section p b, .case-section p strong { color: var(--ink); font-weight: 600; }
.case-section ul { padding-left: 18px; margin: 14px 0; }
.case-section ul li { margin-bottom: 6px; }

.pullquote {
  margin: 32px 0;
  padding: 14px 22px;
  border-left: 3px solid var(--accent);
  font-family: var(--display);
  font-style: italic;
  font-size: 24px;
  line-height: 1.3;
  color: var(--ink);
  max-width: var(--measure);
}

.figure {
  margin: 28px 0;
}
.figure .frame {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-3);
  box-shadow: 0 1px 0 var(--line-soft);
}
.figure .frame.dark { background: #0e0c08; }
.figure .caption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.figure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* next-project / footer-nav */
.casefoot {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.casefoot a { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13px; color: var(--ink); border-bottom: 1px solid transparent; padding-bottom: 2px; transition: border-color .15s, color .15s; }
.casefoot a:hover { color: var(--accent); border-color: var(--accent); }

/* ───── contact ───── */
.contact h1 {
  font-size: 84px;
  line-height: 0.95;
  letter-spacing: -0.04em;
  max-width: 10ch;
  margin-top: 8px;
}
.contact h1 .period { color: var(--accent); }
.contact .lead {
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 560px;
  margin-top: 20px;
}
.email-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 14px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 18px;
  color: var(--ink);
  background: var(--paper-2);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.email-cta:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); box-shadow: 0 6px 20px -10px rgba(0,0,0,.3); }
.email-cta .arrow { display: inline-block; transition: transform .2s; }
.email-cta:hover .arrow { transform: translateX(4px); }

/* toast for email-copy fallback */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.01em;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.contact-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  max-width: 820px;
}
.contact-grid .col h3 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 12px;
}
.contact-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.contact-grid ul li { font-size: 17px; line-height: 1.4; color: var(--ink-2); padding-left: 16px; position: relative; }
.contact-grid ul li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
.contact-grid ul li a {
  border-bottom: 1px solid transparent;
  transition: border-color .15s, color .15s;
}
.contact-grid ul li a:hover { color: var(--accent); border-color: var(--accent); }

.contact-foot {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--accent-2);
  color: var(--accent-2);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}
.status-pill .dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent-2) 22%, transparent);
}

/* ───── 404 ───── */
.notfound {
  min-height: calc(100vh - 70px);
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: 40px 32px;
}
.notfound .glyph-404 {
  position: relative;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(180px, 30vw, 320px);
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: var(--ink);
}
.notfound .glyph-404 .zero { color: var(--accent); display: inline-block; }
.notfound .scribble {
  position: absolute;
  top: -18px; right: -110px;
  transform: rotate(-6deg);
  transform-origin: left center;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
}
.notfound .scribble::before {
  content: "↙";
  display: inline-block;
  margin-right: 6px;
  color: var(--accent);
  font-style: normal;
  font-size: 1.4em;
  transform: translateY(2px);
}
.notfound .msg {
  margin-top: 18px;
  font-size: 22px;
  color: var(--ink-2);
  max-width: 540px;
  text-wrap: pretty;
}
.notfound .actions {
  margin-top: 28px;
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}
.btn {
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  transition: background .15s, color .15s, transform .15s;
}
.btn:hover { background: var(--paper-2); transform: translateY(-1px); }
.btn.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.solid:hover { background: var(--accent); border-color: var(--accent); color: #fff8f3; }

/* ───── teaser (coming soon page) ───── */
.teaser-hero {
  margin: 40px 0;
  padding: 56px 48px;
  border: 1px dashed var(--line-soft);
  border-radius: 12px;
  background:
    radial-gradient(circle at 25% 10%, rgba(196,69,28,0.08) 0, transparent 55%),
    var(--paper-2);
  text-align: center;
}
html[data-theme="dark"] .teaser-hero {
  background:
    radial-gradient(circle at 25% 10%, rgba(232,122,79,0.08) 0, transparent 55%),
    var(--paper-2);
}
.teaser-hero .stamp {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.teaser-hero h2 {
  font-size: 48px;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  text-wrap: balance;
}
.teaser-hero p {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.5;
}

/* sample chat preview reuse on chatbot page */
.chat-preview {
  max-width: 460px;
  margin: 32px auto 0;
  display: flex; flex-direction: column; gap: 10px;
  font-family: var(--body);
  font-size: 14px;
  text-align: left;
}
.chat-preview .bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.4;
}
html[data-theme="dark"] .chat-preview .bubble { background: #2a251c; }
.chat-preview .bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff8f3;
  border-color: transparent;
  border-bottom-right-radius: 4px;
}
.chat-preview .bubble.bot {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-preview .bubble.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.chat-preview .bubble.typing i {
  width: 6px; height: 6px; border-radius: 999px; background: var(--muted); display: block;
  animation: chatdot 1.2s infinite ease-in-out;
}
.chat-preview .bubble.typing i:nth-child(2){ animation-delay: .15s; }
.chat-preview .bubble.typing i:nth-child(3){ animation-delay: .30s; }
@keyframes chatdot {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40%           { opacity: 1;   transform: translateY(-2px); }
}

/* ───── responsive ───── */
@media (max-width: 860px) {
  :root { --pad-x: 28px; }
  .page { padding: 32px var(--pad-x) 72px; }
  .topnav { padding: 14px 24px; }
  .case-head h1 { font-size: 52px; }
  .case-body { grid-template-columns: 1fr; gap: 16px; }
  .toc { position: relative; top: 0; flex-direction: row; flex-wrap: wrap; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 12px; }
  .toc .label { width: 100%; }
  .contact h1 { font-size: 56px; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .figure-grid { grid-template-columns: 1fr; }
  .casefoot { flex-direction: column; gap: 12px; align-items: flex-start; }
}
