/* ============================================================
   BCHAN Studio — shared styles for all pages
   ============================================================ */

/* --- Self-hosted fonts (latin subset, variable woff2) ------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/fraunces.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/fraunces-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/hanken-grotesk.woff2") format("woff2");
}

/* --- Design tokens ----------------------------------------- */
:root {
  color-scheme: dark;
  --ink:       #0b0a09;
  --ink-lift:  #14110d;
  --bone:      #ece3d4;
  --bone-dim:  #a89c8b;
  --muted:     #6f655a;
  --accent:    #e0a35e;
  --accent-dim:#b07c3f;
  --hair:      rgba(236, 227, 212, 0.11);
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --wrap-max: 72rem;
  --measure: 65ch;
  --nav-h: 5.25rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; background-color: var(--ink); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--bone);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Atmosphere: fixed backdrop shared by every page -------- */
.atmos { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.atmos::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--ink-lift), transparent 55%),
    radial-gradient(100% 100% at 50% 120%, #0e0b07, transparent 60%),
    var(--ink);
}
.grain {
  position: fixed; inset: -150%; z-index: 2; pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: drift 8s steps(6) infinite;
}
@keyframes drift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(6%, 4%); }
}
.vignette {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  box-shadow: inset 0 0 22vmax rgba(0, 0, 0, 0.55);
}

/* --- Layout helpers ---------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: clamp(1.4rem, 4vw, 3rem);
}
.site-header, main, .site-footer { position: relative; z-index: 5; }
main { flex: 1 1 auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink-lift); color: var(--bone);
  padding: 0.7rem 1rem; border: 1px solid var(--hair); border-radius: 6px;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* --- Shared header ----------------------------------------- */
.site-header { padding-block: clamp(1.1rem, 2.6vw, 1.6rem); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.monogram {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-size: clamp(0.62rem, 1.05vw, 0.72rem);
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--bone); text-decoration: none;
}
.monogram .glyph {
  display: grid; place-items: center;
  width: 1.85rem; height: 1.85rem;
  border: 1px solid var(--hair); border-radius: 6px;
  font-family: "Fraunces", serif; font-style: italic; font-size: 1rem;
  letter-spacing: 0; color: var(--accent);
}
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.site-nav a {
  font-size: clamp(0.62rem, 1.05vw, 0.72rem);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bone-dim); text-decoration: none;
  transition: color 0.4s var(--ease);
}
.site-nav a:hover { color: var(--bone); }
.site-nav a[aria-current="page"] { color: var(--accent); }

/* --- Hero (home) : full-bleed, fills first screen ---------- */
.hero {
  min-height: calc(100svh - var(--nav-h));
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(2rem, 6vh, 4rem) clamp(1.4rem, 4vw, 3rem);
}
.mark {
  font-family: "Fraunces", serif; font-weight: 400;
  line-height: 0.86; letter-spacing: -0.015em; color: var(--bone);
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
}
.line { display: block; overflow: hidden; padding: 0.06em 0.04em; margin: -0.02em 0; }
.line .reveal { display: inline-block; will-change: transform; }
.line-1 .reveal { font-size: clamp(3.4rem, 15vw, 13.5rem); }
.line-2 {
  margin-left: clamp(0.6rem, 9vw, 7rem);
  margin-top: clamp(-0.4rem, -1vw, -0.1rem);
}
.line-2 .reveal {
  font-style: italic; font-weight: 500;
  font-size: clamp(2.9rem, 12.5vw, 11.5rem); color: var(--bone);
}
.line-2 .reg {
  font-style: normal; font-size: clamp(0.8rem, 2vw, 1.6rem);
  vertical-align: top; color: var(--accent); margin-left: 0.25em; letter-spacing: 0;
}
.lede {
  margin-top: clamp(1.6rem, 4vh, 2.8rem);
  max-width: 34ch;
  font-size: clamp(0.95rem, 1.5vw, 1.12rem); line-height: 1.5;
  color: var(--bone-dim);
}
.hero-status {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: clamp(1.4rem, 3.5vh, 2.2rem);
  font-size: clamp(0.62rem, 1vw, 0.72rem);
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--bone-dim);
}

/* --- Home content sections --------------------------------- */
.section { padding-block: clamp(3.5rem, 9vh, 7rem); border-top: 1px solid var(--hair); }
.eyebrow {
  display: block; margin-bottom: 1.3rem;
  font-size: clamp(0.62rem, 1vw, 0.72rem);
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--accent);
}
.statement {
  max-width: 24ch;
  font-family: "Fraunces", serif; font-weight: 400;
  font-size: clamp(1.7rem, 4.2vw, 3rem); line-height: 1.15;
  letter-spacing: -0.01em; color: var(--bone);
}
.statement + p { margin-top: 1.4rem; max-width: 46ch; color: var(--bone-dim); line-height: 1.6; }

.section h2 {
  font-family: "Fraunces", serif; font-weight: 400;
  font-size: clamp(1.6rem, 3.6vw, 2.6rem); line-height: 1.1;
  letter-spacing: -0.01em; color: var(--bone);
}

/* Flagship app card */
.card {
  margin-top: 2rem; max-width: 44rem;
  padding: clamp(1.6rem, 3vw, 2.4rem);
  border: 1px solid var(--hair); border-radius: 14px;
  background: linear-gradient(160deg, var(--ink-lift), var(--ink));
}
.card h3 {
  font-family: "Fraunces", serif; font-style: italic; font-weight: 500;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem); color: var(--bone); line-height: 1.05;
}
.card .tagline { margin-top: 0.5rem; color: var(--bone-dim); font-size: 1.05rem; }
.card p { margin-top: 1rem; max-width: 48ch; color: var(--bone-dim); line-height: 1.6; }
.badge {
  display: inline-flex; align-items: center; gap: 0.55rem; margin-top: 1.5rem;
  padding: 0.42rem 0.85rem; border: 1px solid var(--hair); border-radius: 999px;
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--bone-dim);
}
.card .more { margin-top: 1.3rem; font-size: 0.9rem; color: var(--muted); }
.card .more a { color: var(--bone-dim); }
.building-note { margin-top: 1.4rem; font-size: 0.9rem; color: var(--muted); }

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 0 rgba(224, 163, 94, 0.5);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(224, 163, 94, 0.45); }
  70%  { box-shadow: 0 0 0 9px rgba(224, 163, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 163, 94, 0); }
}

/* About teaser + contact CTA */
.section .body { margin-top: 1.4rem; max-width: 48ch; color: var(--bone-dim); line-height: 1.6; }
.cta-email {
  display: inline-block; margin-top: 0.4rem;
  font-family: "Fraunces", serif; font-size: clamp(1.6rem, 4.5vw, 2.8rem);
  color: var(--accent); text-decoration: none; letter-spacing: -0.01em;
  transition: color 0.3s var(--ease);
}
.cta-email:hover { color: var(--bone); }

/* Inline link style for body copy */
.link {
  color: var(--accent); text-decoration: none; white-space: nowrap;
  border-bottom: 1px solid rgba(224, 163, 94, 0.4); padding-bottom: 1px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.link:hover { color: var(--bone); border-color: var(--bone); }

/* --- Content pages: page head + prose ---------------------- */
.page-main { padding-block: clamp(2.5rem, 6vh, 4.5rem); }
.page-head { margin-bottom: clamp(2rem, 5vh, 3rem); }
.page-head h1 {
  font-family: "Fraunces", serif; font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1; letter-spacing: -0.015em;
  color: var(--bone);
}
.page-head .lede {
  margin-top: 1.1rem; max-width: 48ch; color: var(--bone-dim);
  font-size: clamp(1rem, 1.6vw, 1.2rem); line-height: 1.5;
}
.meta { margin-top: 0.7rem; font-size: 0.8rem; letter-spacing: 0.04em; color: var(--muted); }

.prose { max-width: var(--measure); line-height: 1.7; color: var(--bone); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  font-family: "Fraunces", serif; font-weight: 400; line-height: 1.2;
  font-size: clamp(1.4rem, 3vw, 1.9rem); color: var(--bone);
  margin-top: 2.4em; margin-bottom: 0.2em;
}
.prose h2:first-child { margin-top: 0; }
.prose ul { margin-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--bone); font-weight: 500; }
.prose .callout {
  padding: 1rem 1.2rem; border-left: 2px solid var(--accent-dim);
  background: var(--ink-lift); color: var(--bone-dim); font-size: 0.95rem; border-radius: 0 8px 8px 0;
}

/* About sections */
.stack { display: grid; gap: clamp(2.4rem, 6vh, 4rem); }
.stack section { max-width: 56ch; }
.stack h2 {
  font-family: "Fraunces", serif; font-weight: 400; line-height: 1.15;
  font-size: clamp(1.4rem, 3vw, 2rem); color: var(--bone); margin-bottom: 0.7rem;
}
.stack p { color: var(--bone); line-height: 1.7; }
.stack p + p { margin-top: 1rem; }
.values { list-style: none; display: grid; gap: 0.8rem; margin-top: 0.4rem; }
.values li { color: var(--bone); line-height: 1.6; }
.values strong { color: var(--bone); font-weight: 500; }

/* Contact info list */
.info { display: grid; gap: 1.7rem; max-width: 42rem; }
.info > div { display: grid; gap: 0.35rem; }
.info dt {
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent);
}
.info dd { font-size: 1.1rem; color: var(--bone); }
.info dd a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(224,163,94,0.4); }
.info dd a:hover { color: var(--bone); border-color: var(--bone); }

/* --- Shared footer ----------------------------------------- */
.site-footer {
  margin-top: auto; border-top: 1px solid var(--hair);
  padding-block: clamp(2rem, 5vh, 3rem);
}
.site-footer .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem 2rem; font-size: 0.8rem; color: var(--bone-dim);
}
.footer-legal { line-height: 1.5; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.footer-nav a { color: var(--bone-dim); text-decoration: none; transition: color 0.3s var(--ease); }
.footer-nav a:hover { color: var(--bone); }

/* --- Focus ------------------------------------------------- */
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* --- Entrance animation (home hero) ------------------------ */
.reveal { transform: translateY(118%); }
.ready .reveal { transform: translateY(0); transition: transform 1.15s var(--ease); }
.ready .line-1 .reveal { transition-delay: 0.05s; }
.ready .line-2 .reveal { transition-delay: 0.18s; }
.rise { opacity: 0; transform: translateY(14px); }
.ready .rise { opacity: 1; transform: translateY(0); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.ready .d1 { transition-delay: 0.45s; }
.ready .d2 { transition-delay: 0.60s; }
.ready .d3 { transition-delay: 0.72s; }
.ready .d4 { transition-delay: 0.84s; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 600px) {
  .site-nav { gap: 1rem; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .dot { animation: none; }
  .reveal, .ready .reveal,
  .rise, .ready .rise { transition: none !important; transform: none; opacity: 1; }
}
