/* ═══════════════════════════════════════════════
   JANIS WYDEN  ·  Design System v3
   Papier. Tinte. Typografie.
═══════════════════════════════════════════════ */

:root {
  --bg:      #f7f4ee;
  --surface: #f0ece3;
  --text:    #1c1e26;
  --mid:     #68655e;
  --dim:     #a8a49c;
  --accent:  #1c3a5a;
  --line:    rgba(28, 30, 38, 0.1);
  --line-md: rgba(28, 30, 38, 0.18);

  --ff-d:  'Fraunces',     'Georgia', serif;
  --ff-s:  'EB Garamond',  'Georgia', serif;
  --ff-g:  'Space Grotesk','Helvetica Neue', sans-serif;

  --nav-h: 52px;
  --max:   1080px;
  --read:  640px;
  --ease:  cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img  { display: block; max-width: 100%; }
a    { text-decoration: none; color: inherit; }
ul   { list-style: none; }
button { background: none; border: none; cursor: pointer; font: inherit; }

/* ── Base ── */
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--ff-g);
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  animation: arrive 0.45s var(--ease) both;
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* Paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='280' height='280' filter='url(%23g)'/%3E%3C/svg%3E");
}

nav, main, footer, section, article, header { position: relative; z-index: 1; }

::selection { background: rgba(28, 58, 90, 0.12); }

/* ═══════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════ */
.site-nav {
  position: fixed;
  inset: 0 0 auto;
  height: var(--nav-h);
  z-index: 100;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.site-nav.opaque {
  background: rgba(247, 244, 238, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}

.nav-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--ff-d);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text);
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.55; }

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-family: var(--ff-g);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--text);
  transition: width 0.25s var(--ease);
}

.nav-links a:hover       { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.on::after   { width: 100%; }
.nav-links a.on          { color: var(--text); }

/* Mobile */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  color: var(--mid);
}
.nav-burger span {
  display: block; height: 1px;
  background: currentColor;
  transition: all 0.22s ease;
}
.nav-burger span:nth-child(1) { width: 22px; }
.nav-burger span:nth-child(2) { width: 22px; }
.nav-burger span:nth-child(3) { width: 14px; }

.nav-burger.is-open span:nth-child(1) { transform: rotate(45deg) translate(4px,4px); width: 18px; }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: rotate(-45deg) translate(3px,-3px); width: 18px; }

.nav-drawer {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 0;
  background: var(--bg);
  z-index: 99;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 2rem;
  gap: 0;
  border-top: 1px solid var(--line);
}

.nav-drawer.is-open { display: flex; }

.nav-drawer a {
  font-family: var(--ff-d);
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 300;
  color: var(--dim);
  transition: color 0.2s;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  width: 100%;
}
.nav-drawer a:hover,
.nav-drawer a.on { color: var(--text); }

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
main { padding-top: var(--nav-h); }
.outer { max-width: var(--max);  margin: 0 auto; padding: 0 2rem; }
.slim  { max-width: var(--read); margin: 0 auto; padding: 0 2rem; }

/* ═══════════════════════════════════════════
   TYPE HELPERS
═══════════════════════════════════════════ */

/* Label / eyebrow */
.label {
  font-family: var(--ff-g);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

/* Section heading */
.sh {
  font-family: var(--ff-d);
  font-weight: 300;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text);
}
.sh em { font-style: italic; color: var(--mid); }

/* Body */
.body {
  font-family: var(--ff-s);
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--mid);
}
.body p + p { margin-top: 1.2em; }
.body em    { font-style: italic; color: var(--text); }

/* Thin rule */
.rule {
  border: none;
  border-top: 1px solid var(--line);
}

/* ═══════════════════════════════════════════
   SCROLL REVEAL
═══════════════════════════════════════════ */
.r {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.r.in { opacity: 1; transform: none; }
.r.d1 { transition-delay: 0.1s; }
.r.d2 { transition-delay: 0.22s; }
.r.d3 { transition-delay: 0.34s; }
.r.d4 { transition-delay: 0.46s; }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  display: inline-block;
  font-family: var(--ff-g);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  transition: all 0.2s ease;
}

.btn-ink {
  background: var(--text);
  color: var(--bg);
}
.btn-ink:hover { background: var(--accent); }

.btn-outline {
  border: 1px solid var(--line-md);
  color: var(--mid);
}
.btn-outline:hover { border-color: var(--text); color: var(--text); }

.link-arrow {
  font-family: var(--ff-g);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  transition: color 0.2s;
}
.link-arrow:hover { color: var(--accent); }

/* ═══════════════════════════════════════════
   COVER PLACEHOLDER
═══════════════════════════════════════════ */
.cover-ph {
  aspect-ratio: 2 / 3;
  background: var(--surface);
  border: 1px solid var(--line-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--dim);
}
.cover-ph span {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--ff-g);
}

/* ═══════════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 0.45rem; }
.field label { font-family: var(--ff-g); font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--dim); }

.field input,
.field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-md);
  color: var(--text);
  font-family: var(--ff-s);
  font-size: 1rem;
  font-weight: 400;
  padding: 0.7rem 0;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  border-radius: 0;
}
.field input:focus,
.field textarea:focus { border-bottom-color: var(--text); }
.field input::placeholder,
.field textarea::placeholder { color: var(--dim); font-style: italic; }
.field textarea { resize: none; }

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.site-footer {
  background: var(--text);
  padding: 4.5rem 0 3.5rem;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem 4rem;
  align-items: start;
}
.footer-name {
  font-family: var(--ff-d);
  font-weight: 300;
  font-size: 1rem;
  color: rgba(247,244,238,0.45);
}
.footer-name small {
  display: block;
  font-family: var(--ff-g);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247,244,238,0.2);
  margin-top: 0.3rem;
  font-style: normal;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: flex-end; }
.footer-nav a {
  font-family: var(--ff-g);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247,244,238,0.28);
  transition: color 0.2s;
}
.footer-nav a:hover { color: rgba(247,244,238,0.65); }
.footer-copy {
  grid-column: 1 / -1;
  font-family: var(--ff-d);
  font-style: italic;
  font-size: 0.82rem;
  color: rgba(247,244,238,0.2);
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(247,244,238,0.07);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 760px) {
  :root { --nav-h: 50px; }
  .nav-links  { display: none; }
  .nav-burger { display: flex; }
  .outer, .slim { padding: 0 1.25rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-nav { justify-content: flex-start; }
}
