/*
 * Shared design system.
 *
 * Near-black ground, warm bone ink, one muted gold accent. Serif display
 * against a quiet sans body — the register is "small studio that does not
 * advertise", which is also the register the copy has to hold.
 */

:root {
  --bg:        #08080a;
  --bg-raised: #0e0e11;
  --bg-sunken: #050506;
  --ink:       #eceae5;
  --ink-dim:   #a5a29a;
  --muted:     #6f6d66;
  --line:      #1c1c20;
  --line-soft: #141417;
  --accent:    #c9b896;
  --accent-dim:#8d7f66;
  --danger:    #c98b7f;
  --ok:        #8fae8b;

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  --mono:  ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(20px, 5vw, 64px);
  --measure: 1180px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Atmosphere: two barely-there pools of light that drift, plus a fixed grain
   layer. Both are decorative and sit behind everything, never intercepting
   pointer events. */
body::before {
  content: "";
  position: fixed;
  inset: -30vmax;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 22% 12%, rgba(201, 184, 150, .07), transparent 62%),
    radial-gradient(44vmax 44vmax at 82% 78%, rgba(120, 138, 170, .06), transparent 62%);
  animation: drift 46s var(--ease) infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .38;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(2.5vmax, -2vmax, 0) scale(1.08); }
}

/* ── Type ─────────────────────────────────────────────────────────────── */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.015em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 7vw, 5.1rem); line-height: 1.02; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem);   line-height: 1.1; }
h3 { font-size: 1.16rem; line-height: 1.35; }

p { margin: 0; text-wrap: pretty; }

a { color: inherit; text-decoration: none; }

.eyebrow {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.lede  { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--ink-dim); max-width: 56ch; }
.small { font-size: .87rem; color: var(--muted); }
.serif { font-family: var(--serif); }

/* ── Layout ───────────────────────────────────────────────────────────── */

.wrap { max-width: var(--measure); margin: 0 auto; padding-inline: var(--gutter); }

section { padding-block: clamp(72px, 11vw, 152px); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ── Chrome ───────────────────────────────────────────────────────────── */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 20px var(--gutter);
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 8, 10, .72);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}

.mark {
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  padding-left: .34em; /* optical: balances the trailing letter-space */
}

.nav-spacer { flex: 1; }

.nav-link {
  font-size: .74rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-dim); transition: color .25s var(--ease);
}
.nav-link:hover { color: var(--ink); }

/* The signed-in destination (Dashboard), injected by navsession.js on every
   public page — lifted so it reads as the one personal item among generic
   links. Lives here, not in dashboard.css, because it appears site-wide. */
.nav-link-accent { color: var(--accent); }
.nav-link-accent:hover { color: var(--ink); }

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  --btn-fg: var(--bg);
  --btn-bg: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  font: inherit; font-size: .8rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 15px 30px;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-bg); border-radius: 2px;
  cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease),
              border-color .3s var(--ease), transform .3s var(--ease), opacity .2s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }

.btn.ghost { --btn-fg: var(--ink); --btn-bg: transparent; border-color: var(--line); }
.btn.ghost:hover { background: transparent; border-color: var(--accent); color: var(--accent); }

.btn.small { padding: 9px 16px; font-size: .7rem; }

/* Understated text link with a rule that draws in on hover. */
.link-arrow {
  display: inline-flex; align-items: center; gap: .55em;
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); position: relative; padding-bottom: 5px;
}
.link-arrow::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--ease);
}
.link-arrow:hover::after { transform: scaleX(1); }

/* ── Reveal on scroll ─────────────────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity .95s var(--ease), transform .95s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  body::before { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ── Forms ────────────────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 8px; }

label.field-label {
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}

input[type="text"], input[type="email"], input[type="number"], textarea, select {
  width: 100%;
  font: inherit; color: var(--ink);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 13px 15px;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
textarea { resize: vertical; min-height: 132px; line-height: 1.6; }

input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent-dim); background: var(--bg-raised);
}
input::placeholder, textarea::placeholder { color: #4a4944; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236f6d66' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 38px;
}

.field-error { font-size: .8rem; color: var(--danger); }
input.bad, textarea.bad, select.bad { border-color: var(--danger); }

/* Checkboxes and on/off switches live in controls.css — loaded only by the
   pages that have them (/console, /dashboard). */

/* ── Notices ──────────────────────────────────────────────────────────── */

.notice {
  padding: 13px 17px; border-radius: 2px; font-size: .9rem;
  border: 1px solid var(--line); background: var(--bg-raised); color: var(--ink-dim);
}
.notice.ok   { border-color: rgba(143, 174, 139, .4); color: var(--ok); }
.notice.err  { border-color: rgba(201, 139, 127, .4); color: var(--danger); }
.notice:empty { display: none; }

/* ── Footer ───────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 56px;
  display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
  font-size: .78rem; color: var(--muted);
}
