/* Moth & Match: one stylesheet for every page. Mobile first.
   Look: a candlelit curiosity cabinet. Dark room, gold leaf, aged-paper cards. */

@font-face {
  font-family: "MM Display"; /* subset of Rye (SIL OFL 1.1), renamed as the licence requires; see fonts/OFL.txt */
  src: url("fonts/mm-display.woff") format("woff");
  font-display: swap;
}

:root {
  --ink: #0b0907;
  --soot: #15100b;
  --brown: #2b2210;
  --gold: #d6a23a;
  --gold-light: #e8cf8f;
  --tan: #c2a050;
  --cream: #f4e9d0;
  --paper: #efe2c3;
  --paper-edge: #b8995c;
  --paper-ink: #2a1d10;
  --paper-muted: #5c4529;
  --oxblood: #7a2216;
  --oxblood-dark: #4e140b;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --display: "MM Display", "Iowan Old Style", Palatino, Georgia, serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img { max-width: 100%; height: auto; display: block; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  background-image:
    radial-gradient(ellipse 120% 70% at 50% 0%, #2a1e0e 0%, rgba(11, 9, 7, 0) 60%),
    radial-gradient(ellipse 90% 60% at 50% 100%, #1a120a 0%, rgba(11, 9, 7, 0) 70%);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
}

/* film grain over the whole room */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("art/grain.webp");
  opacity: 0.07;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--gold-light); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--gold); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; padding: 0.5rem 1rem; background: var(--gold); color: var(--ink); z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

.page { position: relative; z-index: 1; }

/* ornaments */
.orn { display: block; width: 13rem; max-width: 70%; height: 1.25rem; margin: 0 auto; color: var(--tan); }
.orn--ink { color: var(--paper-edge); }

/* masthead */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(194, 160, 80, 0.22);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--gold-light); text-decoration: none; font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.06em; }
.brand img { width: 2rem; height: 2rem; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.nav a { color: var(--tan); text-decoration: none; font-size: 0.82rem; letter-spacing: 0.18em; text-transform: uppercase; }
.nav a:hover { color: var(--gold-light); }

/* hero */
.hero { position: relative; text-align: center; padding: 3rem 1rem 3.5rem; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: min(52rem, 170vw);
  transform: translateX(-50%);
  /* closest-side keeps the glow fully faded before the hero's edges, so it never shows a cut line */
  background: radial-gradient(closest-side at 50% 45%, rgba(240, 168, 64, 0.28) 0%, rgba(214, 162, 58, 0.1) 45%, rgba(11, 9, 7, 0) 100%);
  animation: candle 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes candle {
  0%, 100% { opacity: 1; }
  22% { opacity: 0.86; }
  38% { opacity: 0.97; }
  61% { opacity: 0.82; }
  80% { opacity: 0.95; }
}
.emblem { position: relative; width: min(340px, 78vw); margin: 0 auto 1.75rem; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.7)); }
.wordmark {
  position: relative;
  margin: 0 0 0.9rem;
  font-family: var(--display);
  font-weight: normal;
  font-size: clamp(2.5rem, 11vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--gold);
  background: linear-gradient(180deg, #f6dc9a 0%, #d6a23a 48%, #9c6c1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
.tagline { position: relative; margin: 1rem auto 0; max-width: 34rem; text-wrap: balance; font-style: italic; font-size: 1.25rem; color: var(--cream); }

/* section heads */
.section { padding: 3.5rem 1rem; }
.section-head { text-align: center; margin-bottom: 2.75rem; }
.kicker { margin: 0 0 0.35rem; font-size: 0.8rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--tan); }
.section-head h2 { margin: 0 0 0.9rem; font-family: var(--display); font-weight: normal; font-size: clamp(1.9rem, 7vw, 2.6rem); line-height: 1.1; letter-spacing: 0.03em; color: var(--gold-light); }

/* the works: aged-paper cards */
.works { display: grid; gap: 4.5rem 2.5rem; max-width: 64rem; margin: 0 auto; padding-top: 4.5rem; }

.card {
  position: relative;
  padding: 1.5rem 1.25rem 1.75rem;
  color: var(--paper-ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 18% 8%, rgba(255, 252, 240, 0.55) 0%, rgba(255, 252, 240, 0) 55%),
    radial-gradient(ellipse at 85% 95%, rgba(128, 86, 34, 0.24) 0%, rgba(128, 86, 34, 0) 55%),
    radial-gradient(ellipse at 0% 60%, rgba(128, 86, 34, 0.14) 0%, rgba(128, 86, 34, 0) 40%),
    url("art/paper.webp");
  background-blend-mode: normal, normal, normal, multiply;
  border: 1px solid var(--paper-edge);
  border-radius: 3px;
  box-shadow: 0 2px 0 rgba(255, 240, 200, 0.15) inset, 0 34px 70px -24px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0.55rem;
  border: 3px double rgba(92, 69, 41, 0.55);
  border-radius: 2px;
  pointer-events: none;
}
.card > * { position: relative; }

.frame { margin: 0 0 1.4rem; padding: 0.55rem; background: #1a130b; border: 1px solid #6e5428; box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px rgba(92, 69, 41, 0.6); }
.frame img { width: 100%; }
.frame--label { max-width: 15rem; margin-left: auto; margin-right: auto; padding: 0; background: none; border: 0; box-shadow: 0 16px 30px -12px rgba(30, 15, 5, 0.75); transform: rotate(-1.2deg); }

.peeker { position: absolute; top: -7.3rem; right: 1.6rem; width: 3.4rem; z-index: 2; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.5)); }

.tag {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.1rem 0.6rem;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-muted);
  border: 1px solid rgba(92, 69, 41, 0.5);
  border-radius: 999px;
}
.card h3 { margin: 0; font-family: var(--display); font-weight: normal; font-size: clamp(1.9rem, 7vw, 2.4rem); line-height: 1.1; letter-spacing: 0.02em; color: var(--oxblood-dark); }
.card .sub { margin: 0.25rem 0 0.9rem; font-style: italic; color: var(--paper-muted); }
.card p { margin: 0 0 0.9rem; }
.card .note { font-size: 0.95rem; font-style: italic; color: var(--paper-muted); }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }
.btn {
  display: inline-block;
  padding: 0.55rem 1rem 0.5rem;
  font-family: var(--display);
  font-size: 0.98rem;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-decoration: none;
  color: var(--cream);
  background: var(--oxblood);
  border: 1px solid var(--oxblood-dark);
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px rgba(244, 233, 208, 0.22), 0 3px 0 var(--oxblood-dark);
}
.btn:hover { color: #fff7e2; background: #8d2a1c; }
.actions { align-items: center; }
.card .also { margin: 0; font-size: 0.98rem; color: var(--paper-muted); }
.card .also a { color: var(--oxblood); text-decoration-color: rgba(122, 34, 22, 0.45); }
.card .also a:hover { color: var(--oxblood-dark); }

/* the studio */
.studio { max-width: 38rem; margin: 0 auto; }
.studio p { margin: 0 0 1.1rem; }
.studio .lede::first-letter {
  float: left;
  margin: 0.08em 0.12em 0 0;
  font-family: var(--display);
  font-size: 3.6em;
  line-height: 0.8;
  color: var(--gold);
}
.studio .signoff { text-align: center; font-style: italic; color: var(--tan); }

/* write to us: a calling card */
.calling-card {
  position: relative;
  max-width: 30rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 1.9rem;
  text-align: center;
  color: var(--paper-ink);
  background-color: var(--paper);
  background-image: radial-gradient(ellipse at 30% 0%, rgba(255, 252, 240, 0.6) 0%, rgba(255, 252, 240, 0) 60%), url("art/paper.webp");
  background-blend-mode: normal, multiply;
  border: 1px solid var(--paper-edge);
  border-radius: 3px;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.9);
  transform: rotate(-0.8deg);
}
.calling-card::before { content: ""; position: absolute; inset: 0.55rem; border: 1px solid rgba(92, 69, 41, 0.5); pointer-events: none; }
.calling-card img { width: 3.6rem; margin: 0 auto 0.7rem; }
.calling-card h2 { margin: 0 0 0.4rem; font-family: var(--display); font-weight: normal; font-size: 1.9rem; color: var(--oxblood-dark); }
.calling-card p { margin: 0 0 0.5rem; }
.calling-card .email { font-size: clamp(1.1rem, 5vw, 1.4rem); color: var(--oxblood); text-decoration-color: rgba(122, 34, 22, 0.45); overflow-wrap: anywhere; }
.calling-card .email:hover { color: var(--oxblood-dark); }
.calling-card .small { font-size: 0.95rem; color: var(--paper-muted); }

/* footer */
.footer { text-align: center; padding: 2.5rem 1rem 3rem; font-size: 0.95rem; color: var(--tan); }
.footer p { margin: 0.4rem 0; }

/* privacy page: the policy is a paper document */
.document {
  position: relative;
  max-width: 44rem;
  margin: 2.5rem auto 0;
  padding: 2rem 1.25rem 1.5rem;
  color: var(--paper-ink);
  background-color: var(--paper);
  background-image: radial-gradient(ellipse at 20% 0%, rgba(255, 252, 240, 0.55) 0%, rgba(255, 252, 240, 0) 50%), radial-gradient(ellipse at 90% 100%, rgba(128, 86, 34, 0.2) 0%, rgba(128, 86, 34, 0) 50%), url("art/paper.webp");
  background-blend-mode: normal, normal, multiply;
  border: 1px solid var(--paper-edge);
  border-radius: 3px;
  box-shadow: 0 34px 70px -24px rgba(0, 0, 0, 0.9);
}
.document::before { content: ""; position: absolute; inset: 0.55rem; border: 3px double rgba(92, 69, 41, 0.45); pointer-events: none; }
.document > * { position: relative; }
.document h1 { margin: 0 0 0.2rem; font-family: var(--display); font-weight: normal; font-size: clamp(2rem, 8vw, 2.6rem); line-height: 1.1; color: var(--oxblood-dark); }
.document .updated { margin: 0 0 1.5rem; font-style: italic; color: var(--paper-muted); }
.document h2 { margin: 1.8rem 0 0.5rem; font-size: 0.95rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--oxblood); }
.document p { margin: 0 0 1rem; }
.document a { color: var(--oxblood); }
.document a:hover { color: var(--oxblood-dark); }

@media (min-width: 46rem) {
  .masthead { padding: 1.25rem 2rem 1rem; }
  .hero { padding: 4.5rem 2rem 4rem; }
  .section { padding: 4.5rem 2rem; }
  .works { grid-template-columns: 1fr 1fr; align-items: start; }
  .card { padding: 2rem 2rem 2.25rem; }
  .card--poppet { margin-top: 3rem; }
  .calling-card { padding: 2.5rem 2.5rem 2.25rem; }
  .document { padding: 3rem 3.25rem 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero::before { animation: none; }
}
