/* Advent Calendar for Friends — hand-drawn Christmas post office theme */

:root {
  --gf-bg: #fcf8ef;
  --gf-card: #fffdf7;
  --gf-text: #18392f;
  --gf-muted: #545454;
  --gf-primary: #174739;
  --gf-primary-dark: #102d27;
  --gf-accent: #d5593f;
  --gf-accent-dark: #b4442e;
  --gf-gold: #dfa43d;
  --gf-success: #16ac7a;
  --gf-border: #e9dec6;
  --gf-radius: 12px;
  --gf-shadow-sm: 0 1px 2px rgba(16, 45, 39, .07);
  --gf-shadow-md: 0 10px 28px rgba(16, 45, 39, .10);
  --gf-font-head: 'DM Serif Text', Georgia, 'Times New Roman', serif;
  --gf-font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --gf-font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gf-wrap: 1120px;
}

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

html, body { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--gf-bg);
  color: var(--gf-text);
  font-family: var(--gf-font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg, video, canvas, iframe { max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--gf-font-head);
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1.15;
  margin: 0 0 16px;
  color: var(--gf-primary-dark);
}

h2 { font-size: 28px; letter-spacing: -.02em; }
h3 { font-size: 18px; }

p { margin: 0 0 16px; }

a { color: var(--gf-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gf-accent); }

.wrap { max-width: var(--gf-wrap); margin: 0 auto; padding: 0 20px; }

.eyebrow {
  font-family: var(--gf-font-mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gf-accent);
  margin: 0 0 14px;
}

svg.ic, svg.sec-icon, svg.faq-icon, svg.rel-icon, svg.footer-ic, svg.legal-ic, svg.notfound-ic {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ic .fill, .sec-icon .fill, .faq-icon .fill, .rel-icon .fill, .footer-ic .fill, .legal-ic .fill, .notfound-ic .fill {
  fill: currentColor;
  stroke: none;
}


/* ---------- header ---------- */

.site-header {
  background: var(--gf-card);
  border-bottom: 1px solid var(--gf-border);
  position: relative;
  z-index: 20;
}

.site-header::before {
  content: "";
  display: block;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--gf-accent) 0 16px, var(--gf-gold) 16px 32px, var(--gf-primary) 32px 48px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gf-text);
}

.brand-mark { flex: none; display: block; }

.brand-name {
  font-family: var(--gf-font-head);
  font-size: 19px;
  letter-spacing: -.01em;
  color: var(--gf-primary-dark);
}

.site-nav { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

.site-nav a {
  color: var(--gf-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: var(--gf-accent); border-bottom-color: var(--gf-gold); }

/* ---------- snowfall ---------- */

.snowfall {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  background-image: radial-gradient(circle, rgba(23, 71, 57, .14) 1.6px, transparent 2.3px);
  background-size: 190px 190px;
  animation: gf-snow-a 24s linear infinite;
}

.snowfall::before, .snowfall::after { content: ""; position: absolute; inset: 0; }

.snowfall::before {
  background-image: radial-gradient(circle, rgba(23, 71, 57, .09) 2.6px, transparent 3.4px);
  background-size: 280px 280px;
  animation: gf-snow-b 38s linear infinite;
}

.snowfall::after {
  background-image: radial-gradient(circle, rgba(223, 164, 61, .22) 1.3px, transparent 2px);
  background-size: 140px 140px;
  animation: gf-snow-c 17s linear infinite;
}

@keyframes gf-snow-a { from { background-position: 0 0; } to { background-position: 0 190px; } }
@keyframes gf-snow-b { from { background-position: 60px 0; } to { background-position: 60px 280px; } }
@keyframes gf-snow-c { from { background-position: 30px 0; } to { background-position: 30px 140px; } }

@media (prefers-reduced-motion: reduce) {
  .snowfall { display: none; }
}


/* ---------- hero / tool ---------- */

.hero { padding: 44px 0 56px; text-align: center; position: relative; }

.hero-art { max-width: 540px; margin: 0 auto 4px; }
.hero-art-sm { max-width: 340px; }
.hero-svg { display: block; width: 100%; height: auto; }

.hero-title {
  font-size: clamp(36px, 7vw, 56px);
  letter-spacing: -.03em;
  line-height: 1.05;
  margin: 0 auto 16px;
  max-width: 22ch;
}

.hero-sub {
  font-size: 18px;
  color: var(--gf-muted);
  max-width: 56ch;
  margin: 0 auto 32px;
}

.tool-shell {
  background: var(--gf-card);
  border: 1px solid var(--gf-border);
  border-radius: calc(var(--gf-radius) + 4px);
  box-shadow: var(--gf-shadow-md);
  padding: 12px;
  text-align: left;
}

.tool-shell [data-gf-tool] {
  display: block;
  width: 100%;
  border: 1.5px dashed var(--gf-border);
  border-radius: var(--gf-radius);
  padding: 20px;
}

/* ---------- content ---------- */

.content-area { padding: 8px 0 64px; position: relative; }

.intro {
  font-size: 18px;
  color: var(--gf-muted);
  max-width: 70ch;
  margin: 0 0 48px;
}

.content-section {
  position: relative;
  background: var(--gf-card);
  border: 1px solid var(--gf-border);
  border-radius: calc(var(--gf-radius) + 2px);
  box-shadow: var(--gf-shadow-sm);
  padding: 28px 32px 24px;
  margin: 0 0 24px;
  transition: box-shadow .18s ease, transform .18s ease;
}

.content-section:hover { box-shadow: var(--gf-shadow-md); transform: translateY(-2px); }

.content-section h2 { margin-bottom: 12px; padding-right: 72px; }

.sec-icon { position: absolute; top: 24px; right: 28px; width: 44px; height: 44px; color: var(--gf-primary); }
.sec-icon.ic-b { display: none; }
.content-section:nth-of-type(even) .sec-icon.ic-a { display: none; }
.content-section:nth-of-type(even) .sec-icon.ic-b { display: block; }
.content-section:nth-of-type(3n) .sec-icon { color: var(--gf-accent); }
.content-section:nth-of-type(3n + 2) .sec-icon { color: var(--gf-gold); }

.section-body, .page-body, .legal-body { max-width: 70ch; }
.section-body p, .page-body p, .legal-body p { margin: 0 0 16px; }
.section-body p:last-child, .page-body p:last-child { margin-bottom: 0; }

.page-body ul, .section-body ul, .legal-body ul,
.page-body ol, .section-body ol, .legal-body ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.page-article, .legal-article { padding: 52px 0 64px; }

.page-title { font-size: clamp(32px, 5vw, 44px); letter-spacing: -.03em; max-width: 22ch; }

.legal-ic { width: 40px; height: 40px; color: var(--gf-gold); margin-bottom: 16px; }


/* ---------- faq ---------- */

.faq { margin: 0 0 56px; }
.faq > h2 { margin-bottom: 20px; }
.faq-list { display: grid; gap: 16px; }

.faq-item {
  position: relative;
  background: var(--gf-card);
  border: 1px solid var(--gf-border);
  border-left: 4px solid var(--gf-accent);
  border-radius: var(--gf-radius);
  box-shadow: var(--gf-shadow-sm);
  padding: 20px 24px 18px 58px;
}

.faq-icon { position: absolute; left: 18px; top: 22px; width: 26px; height: 26px; color: var(--gf-gold); }

.faq-item h3 {
  font-family: var(--gf-font-body);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0;
  margin: 0 0 8px;
  color: var(--gf-text);
}

.faq-answer { color: var(--gf-muted); max-width: 70ch; }
.faq-answer p:last-child { margin-bottom: 0; }

/* ---------- related links ---------- */

.related { margin: 0 0 16px; }
.related > h2 { margin-bottom: 20px; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gf-card);
  border: 1px solid var(--gf-border);
  border-radius: var(--gf-radius);
  box-shadow: var(--gf-shadow-sm);
  padding: 16px 20px;
  color: var(--gf-text);
  text-decoration: none;
  font-weight: 500;
  transition: box-shadow .15s ease, transform .15s ease;
}

.rel-icon { width: 24px; height: 24px; color: var(--gf-gold); flex: none; }

.related-card::after {
  content: "\2192";
  margin-left: auto;
  color: var(--gf-accent);
  font-weight: 700;
  flex: none;
}

.related-card:hover {
  box-shadow: var(--gf-shadow-md);
  transform: translateY(-1px);
  color: var(--gf-primary);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: var(--gf-radius);
  border: 2px solid transparent;
  font-family: var(--gf-font-body);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}

.btn-primary { background: var(--gf-primary); color: #fff; }
.btn-primary:hover { background: var(--gf-primary-dark); color: #fff; transform: translateY(-1px); }

.btn-accent { background: var(--gf-accent-dark); color: #fff; }
.btn-accent:hover { background: #93371f; color: #fff; transform: translateY(-1px); }

.btn-secondary { background: transparent; color: var(--gf-primary); border-color: var(--gf-primary); }
.btn-secondary:hover { color: var(--gf-primary-dark); border-color: var(--gf-primary-dark); }

.btn:focus-visible, a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gf-gold);
  outline-offset: 2px;
}


/* ---------- footer ---------- */

.site-footer {
  background: var(--gf-primary-dark);
  color: #f3ecdc;
  padding: 36px 0 28px;
  position: relative;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}

.footer-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--gf-font-head);
  font-size: 16px;
  color: #f3ecdc;
}

.footer-ic { width: 22px; height: 22px; color: var(--gf-gold); }

.footer-nav { display: flex; gap: 24px; flex-wrap: wrap; }

.footer-nav a { color: rgba(243, 236, 220, .85); text-decoration: none; font-size: 14px; }
.footer-nav a:hover { color: var(--gf-gold); }

.copyright { margin: 0; color: rgba(243, 236, 220, .6); font-size: 13px; }

/* ---------- 404 ---------- */

.notfound { padding: 72px 0 80px; text-align: center; }

.notfound-ic { width: 48px; height: 48px; color: var(--gf-gold); margin-bottom: 12px; }

.notfound-code {
  font-family: var(--gf-font-head);
  font-size: 56px;
  color: var(--gf-accent);
  margin: 0 0 8px;
}

.notfound-text { color: var(--gf-muted); max-width: 46ch; margin: 0 auto 28px; }

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  body { font-size: 16px; }

  .wrap { padding: 0 16px; }

  .header-inner { justify-content: center; padding: 10px 0; }

  .site-nav { gap: 18px; justify-content: center; }

  .hero { padding: 28px 0 40px; }

  .hero-art { max-width: 330px; }
  .hero-art-sm { max-width: 240px; }

  .hero-sub { font-size: 16px; margin-bottom: 24px; }

  .tool-shell { padding: 8px; }
  .tool-shell [data-gf-tool] { padding: 12px; }

  .content-area { padding-bottom: 48px; }

  .intro { margin-bottom: 32px; }

  .content-section { padding: 22px 20px 20px; margin-bottom: 20px; }
  .content-section h2 { padding-right: 56px; }
  .sec-icon { width: 36px; height: 36px; top: 18px; right: 16px; }

  h2 { font-size: 23px; }

  .page-title { font-size: 30px; }

  .faq { margin-bottom: 40px; }
  .faq-item { padding: 18px 18px 16px 50px; }
  .faq-icon { left: 14px; top: 20px; width: 22px; height: 22px; }

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

  .btn { width: 100%; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-nav { justify-content: center; }

  .notfound { padding: 48px 0 56px; }
}
