/* =============================================================
   FlapSnaps — Editorial Institutional Design
   "A serious website. For serious flaps."
   ============================================================= */

/* Fonts loaded non-blocking via <link rel="preload"> in HTML. */

:root {
  /* Palette — aged parchment meets cabinet dispatch box */
  --cream:      #f5f0e8;
  --cream-2:    #ede7d9;
  --cream-3:    #e4dccc;
  --ink:        #1a1612;
  --ink-2:      #2e2820;
  --ink-muted:  #5a5047;
  --ink-faint:  #8a7d6e;

  --accent:     #b5341c;   /* wax seal red */
  --accent-2:   #d4472a;
  --accent-pale:#f5e8e4;
  --gold:       #9a7c3a;
  --gold-light: #c4a55a;

  --rule:       rgba(26, 22, 18, 0.14);
  --rule-heavy: rgba(26, 22, 18, 0.30);

  --radius:     4px;
  --container:  1080px;
  --gutter:     1.5rem;

  --serif:      'Playfair Display', Georgia, 'Times New Roman', serif;
  --body:       'EB Garamond', Georgia, 'Times New Roman', serif;
  --mono:       'DM Mono', 'Courier New', monospace;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.72;
  color: var(--ink);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* subtle paper texture via noise */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

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

/* ─── Links ─── */
a { color: inherit; text-decoration: none; }

p a, li a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
p a:hover, li a:hover { color: var(--accent-2); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}


/* ═══════════════════════════════════════════
   MASTHEAD / HEADER
   ═══════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--rule-heavy);
  box-shadow: 0 1px 0 var(--rule);
}

/* top rule — two lines like a broadsheet */
.site-header::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--ink);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .9rem 0;
}

/* ─── Brand / Masthead ─── */
.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.brand-crest {
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .06em;
  transition: background 150ms, color 150ms;
}

.brand:hover .brand-crest {
  background: var(--accent);
  border-color: var(--accent);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .01em;
  color: var(--ink);
}

.brand-strapline {
  font-family: var(--body);
  font-style: italic;
  font-size: .8rem;
  color: var(--ink-muted);
  letter-spacing: .02em;
}

/* ─── Navigation ─── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.site-nav a {
  position: relative;
  font-family: var(--body);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: .5rem .9rem;
  border: 1px solid transparent;
  transition: color 140ms, border-color 140ms;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: .9rem;
  right: .9rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 200ms ease;
}

.site-nav a:hover {
  color: var(--ink);
}
.site-nav a:hover::after { transform: scaleX(1); }

.site-nav a[aria-current="page"] {
  color: var(--accent);
  border-color: var(--rule);
  background: var(--cream-2);
}
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* dividers between nav items */
.site-nav a + a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 1px;
  background: var(--rule);
}


/* ═══════════════════════════════════════════
   HERO / FRONT PAGE MASTHEAD
   ═══════════════════════════════════════════ */

.hero {
  padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(2.5rem, 4vw, 4rem);
  border-bottom: 3px double var(--rule-heavy);
  position: relative;
  overflow: hidden;
}

/* decorative watermark */
.hero::after {
  content: 'FS';
  position: absolute;
  right: -1rem;
  bottom: -2rem;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(8rem, 20vw, 16rem);
  color: rgba(26,22,18,.04);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.1rem;
}

.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule-heavy);
}

.hero-eyebrow span {
  font-family: var(--mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ink-muted);
  white-space: nowrap;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 5.8rem);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -.02em;
  margin: 0 0 .15em;
  color: var(--ink);
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-rule {
  display: block;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--ink) 60%, transparent);
  margin: 1.2rem 0 1.4rem;
}

.lead {
  font-family: var(--body);
  font-size: 1.2rem;
  color: var(--ink-2);
  line-height: 1.65;
  max-width: 680px;
  margin: 0 0 .9rem;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 1.8rem;
  align-items: center;
}

.email-note {
  margin-top: 1rem;
  font-size: .95rem;
  font-style: italic;
  color: var(--ink-muted);
}


/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */

.button {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: .75rem 1.6rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: background 140ms, color 140ms, border-color 140ms, transform 120ms, box-shadow 140ms;
  text-decoration: none;
}

.button.primary {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.button.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(181,52,28,.22);
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-heavy);
}
.button.ghost:hover {
  background: var(--cream-2);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.button, .button:hover { text-decoration: none; }


/* ═══════════════════════════════════════════
   CONTENT SECTIONS
   ═══════════════════════════════════════════ */

.section {
  padding: clamp(2.8rem, 5vw, 4.5rem) 0;
  border-bottom: 1px solid var(--rule);
}

.section.alt {
  background: var(--cream-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* Section heading with ruled ornament */
h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 1.6rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--ink);
  display: flex;
  align-items: baseline;
  gap: .75rem;
}

h2::after {
  content: '§';
  font-size: .65em;
  color: var(--ink-faint);
  font-weight: 400;
  font-style: italic;
}

h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0;
  margin: 2rem 0 .5rem;
  color: var(--ink-2);
}

h3::before {
  content: '— ';
  color: var(--accent);
  font-style: normal;
}

p { margin: 0 0 1rem; }

strong { font-weight: 600; }

/* page-level h1 (subpages) */
.page-hero { padding: clamp(2.5rem, 5vw, 4rem) 0 2rem; border-bottom: 3px double var(--rule-heavy); }

.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -.02em;
  margin: 0 0 .4rem;
  color: var(--ink);
}

.page-hero .deck {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-muted);
  margin: 0;
  max-width: 640px;
}


/* ═══════════════════════════════════════════
   RULES LIST  (ul.rules)
   ═══════════════════════════════════════════ */

.rules {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 820px;
}

.rules li {
  position: relative;
  padding: .85rem 1rem .85rem 2.5rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 1.05rem;
}

.rules li:first-child { border-top: 1px solid var(--rule); }

.rules li::before {
  content: '✦';
  position: absolute;
  left: .7rem;
  top: .9rem;
  font-size: .65rem;
  color: var(--accent);
}


/* ═══════════════════════════════════════════
   STEPS LIST  (ol.steps)
   ═══════════════════════════════════════════ */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  max-width: 820px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: .9rem 1rem .9rem 3.5rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 1.05rem;
}

.steps li:first-child { border-top: 1px solid var(--rule); }

.steps li::before {
  content: counter(step, upper-roman);
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--cream);
  background: var(--ink);
}

.steps li:nth-child(odd)::before { background: var(--ink-2); }


/* ═══════════════════════════════════════════
   NOTE / ASIDE
   ═══════════════════════════════════════════ */

.note {
  margin-top: 1.4rem;
  max-width: 820px;
  padding: 1rem 1.2rem 1rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-pale);
  font-style: italic;
  color: var(--ink-2);
  font-size: .98rem;
}

/* pull-quote style note variant */
.note.pull {
  border-left: none;
  border-top: 2px solid var(--rule-heavy);
  border-bottom: 2px solid var(--rule-heavy);
  background: transparent;
  padding: 1.2rem 0;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-muted);
  text-align: center;
}


/* ═══════════════════════════════════════════
   SCALE / SPECIAL COMPONENT
   ═══════════════════════════════════════════ */

.scale-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  max-width: 820px;
  border: 1px solid var(--rule-heavy);
  margin-top: 1rem;
}

.scale-item {
  padding: 1.1rem .8rem;
  border-right: 1px solid var(--rule-heavy);
  text-align: center;
  transition: background 150ms;
}

.scale-item:last-child { border-right: none; }

.scale-item:hover { background: var(--cream-2); }

.scale-level {
  display: block;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: .3rem;
}

.scale-label {
  display: block;
  font-family: var(--mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-muted);
  line-height: 1.3;
}

.scale-reaction {
  display: block;
  font-style: italic;
  font-size: .88rem;
  color: var(--ink-faint);
  margin-top: .4rem;
}


/* ═══════════════════════════════════════════
   CREDENTIALS CARD
   ═══════════════════════════════════════════ */

.credentials-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  border: 1px solid var(--rule-heavy);
  max-width: 820px;
  margin: 1.2rem 0;
}

.credentials-sidebar {
  background: var(--ink);
  color: var(--cream);
  padding: 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  min-width: 130px;
}

.credentials-avatar {
  width: 64px;
  height: 64px;
  border: 2px solid rgba(245,240,232,.25);
  border-radius: 2px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--cream);
}

.credentials-title {
  font-family: var(--mono);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(245,240,232,.55);
  text-align: center;
  line-height: 1.4;
}

.credentials-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cream);
  text-align: center;
}

.credentials-body {
  padding: 1.4rem 1.5rem;
}


/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */

.site-footer {
  margin-top: 0;
  background: var(--ink);
  color: var(--cream);
  padding: 2.8rem 0 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.footer-brand-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cream);
}

.footer-brand-sub {
  font-style: italic;
  font-size: .88rem;
  color: rgba(245,240,232,.5);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  align-items: flex-end;
}

.footer-nav a {
  font-size: .9rem;
  color: rgba(245,240,232,.65);
  letter-spacing: .02em;
  transition: color 140ms;
}

.footer-nav a:hover { color: var(--cream); }

.footer-rule {
  width: 100%;
  border: none;
  border-top: 1px solid rgba(245,240,232,.12);
  margin: 1.5rem 0 1rem;
}

.footer-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .82rem;
  color: rgba(245,240,232,.4);
  font-family: var(--mono);
  letter-spacing: .03em;
}

.footer-adults {
  font-family: var(--serif);
  font-style: italic;
  font-size: .9rem;
  color: var(--accent-2);
}


/* ═══════════════════════════════════════════
   PAGE LOAD ANIMATION
   ═══════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow  { animation: fadeUp .5s ease both; }
.hero h1       { animation: fadeUp .55s .08s ease both; }
.hero-rule     { animation: fadeUp .4s .16s ease both; }
.hero .lead    { animation: fadeUp .5s .2s ease both; }
.hero .cta     { animation: fadeUp .5s .28s ease both; }
.hero .email-note { animation: fadeUp .5s .34s ease both; }


/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 820px) {
  .header-inner {
    flex-wrap: wrap;
    gap: .5rem;
    padding: .6rem 0 .5rem;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    border-top: 1px solid var(--rule);
    padding-top: .4rem;
  }

  .scale-grid {
    grid-template-columns: 1fr 1fr;
  }

  .scale-item { border-bottom: 1px solid var(--rule-heavy); }

  .credentials-card {
    grid-template-columns: 1fr;
  }

  .credentials-sidebar {
    flex-direction: row;
    padding: 1rem 1.2rem;
  }

  .footer-nav { align-items: flex-start; }
}

@media (max-width: 520px) {
  .scale-grid { grid-template-columns: 1fr; }
  .scale-item { border-right: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ═══════════════════════════════════════════
   SUBMISSION COUNTER
   ═══════════════════════════════════════════ */

.section--counter {
  padding: 2rem 0;
  background: var(--ink);
  border-top: none;
  border-bottom: none;
}

.counter-block {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.counter-number {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 900;
  color: var(--cream);
  line-height: 1;
  letter-spacing: -.03em;
  min-width: 5ch;
  font-variant-numeric: tabular-nums;
}

.counter-label {
  font-family: var(--body);
  font-style: italic;
  font-size: 1.1rem;
  color: rgba(245, 240, 232, 0.55);
}
