/* ============================================================
   Beacon & Beam — a strategic and creative studio
   Composition: book spread, paper palette, dictated-quote signature
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --ae-offwhite: #F9F7F6;
  --ae-blush: #EDC9C8;
  --ae-pomegranate: #B1534D;
  --ae-mustard: #E1C66D;
  --ae-sea: #1B5497;
  --ae-sky: #DDE4E8;
  --ae-ink: #302B29;
  --ae-white: #FFFFFF;

  /* every value below is drawn from the eight studio colours */
  --bg: var(--ae-offwhite);
  --bg-deep: var(--ae-sky);
  --ink: var(--ae-ink);
  --ink-soft: color-mix(in srgb, var(--ae-ink) 72%, var(--ae-offwhite));
  --accent: var(--ae-pomegranate);
  --secondary: var(--ae-sea);
  --rule: color-mix(in srgb, var(--ae-ink) 22%, var(--ae-offwhite));
  --field: var(--ae-white);

  --gutter: 4px;
  --measure: 68ch;
  --pad: clamp(1.25rem, 5vw, 4.5rem);

  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --mono: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --type: "Special Elite", "Courier New", monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* dark: the lamp is on — soft black paper, warm beam */
html[data-theme="dark"] {
  --bg: var(--ae-ink);
  --bg-deep: color-mix(in srgb, var(--ae-ink) 82%, var(--ae-white));
  --ink: var(--ae-offwhite);
  --ink-soft: color-mix(in srgb, var(--ae-offwhite) 68%, var(--ae-ink));
  --accent: var(--ae-blush);
  --secondary: var(--ae-sky);
  --rule: color-mix(in srgb, var(--ae-offwhite) 20%, var(--ae-ink));
  --field: color-mix(in srgb, var(--ae-white) 6%, var(--ae-ink));
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(0.9rem, 0.55vw + 0.78rem, 1rem);
  line-height: 1.75;
  font-weight: 400;
  text-wrap: pretty;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

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

/* ---------- type ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.005em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.9rem, 9.5vw, 7rem); }
h2 { font-size: clamp(2.1rem, 5.2vw, 3.8rem); }
h3 { font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.12; }
h4 { font-size: 1.2rem; line-height: 1.25; }
p { margin: 0 0 1.15em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.eyebrow, .kicker {
  font-family: var(--type);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}
.kicker { color: var(--ink-soft); }
.lede { font-size: 1.06em; color: var(--ink-soft); }
.small { font-size: 0.82rem; color: var(--ink-soft); }
em { font-style: italic; }

/* ---------- shell ---------- */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 68px;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--serif);
  font-size: 1.28rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0;
}
.brand svg { width: 22px; height: 22px; flex: none; }
.brand .amp { color: var(--accent); }
.brand-logo { width: 140px; height: auto; max-width: min(58vw, 140px); object-fit: contain; }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1.6vw, 1.4rem);
  flex-wrap: wrap;
}
.nav a {
  font-family: var(--type);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.7rem 0.15rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* the header floats over the hero photo — keep it legible there */
.site-head .brand-logo { filter: drop-shadow(0 1px 6px color-mix(in srgb, var(--ae-offwhite) 70%, transparent)); }
html[data-theme="dark"] .site-head .brand-logo { filter: drop-shadow(0 1px 6px color-mix(in srgb, var(--ae-ink) 70%, transparent)); }
.site-head .nav a,
.site-head .theme-btn { text-shadow: 0 1px 8px color-mix(in srgb, var(--ae-offwhite) 85%, transparent); }
html[data-theme="dark"] .site-head .nav a,
html[data-theme="dark"] .site-head .theme-btn { text-shadow: 0 1px 8px color-mix(in srgb, var(--ae-ink) 85%, transparent); }
.site-head .theme-btn { background: color-mix(in srgb, var(--ae-offwhite) 55%, transparent); }
html[data-theme="dark"] .site-head .theme-btn { background: color-mix(in srgb, var(--ae-ink) 55%, transparent); }

.theme-btn {
  background: none;
  border: 1px solid var(--rule);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.theme-btn:hover { border-color: var(--accent); transform: rotate(-12deg); }
.theme-btn svg { width: 17px; height: 17px; }
.theme-btn .moon { display: none; }
html[data-theme="dark"] .theme-btn .moon { display: block; }
html[data-theme="dark"] .theme-btn .sun { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--type);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.95rem 1.6rem;
  min-height: 48px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--ae-white); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--beam { background: var(--accent); border-color: var(--accent); color: var(--ae-white); }
.btn--beam:hover { background: var(--secondary); border-color: var(--secondary); }

/* ---------- the book ---------- */
.book {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  position: relative;
}
.leaf { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.leaf + .leaf { border-top: 1px solid var(--rule); }

@media (min-width: 900px) {
  .book {
    grid-template-columns: 1fr var(--gutter) 1fr;
    column-gap: clamp(2rem, 5vw, 4.5rem);
  }
  .book::before {
    content: "";
    grid-column: 2;
    grid-row: 1 / -1;
    background: linear-gradient(
      to right,
      transparent,
      color-mix(in srgb, var(--rule) 70%, transparent) 22%,
      color-mix(in srgb, var(--ink) 22%, transparent) 50%,
      color-mix(in srgb, var(--rule) 70%, transparent) 78%,
      transparent
    );
  }
  .leaf { grid-column: 1 / -1; padding: clamp(3.5rem, 7vw, 6.5rem) 0; }
  .leaf--split { display: grid; grid-template-columns: 1fr var(--gutter) 1fr; column-gap: clamp(2rem, 5vw, 4.5rem); }
  .leaf--split > * { grid-column: auto; }
  .leaf--split > .span { grid-column: 1 / -1; }
  .leaf--split > .verso { grid-column: 1; }
  .leaf--split > .recto { grid-column: 3; }
}

/* page-turn on navigation */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: turn-out 0.42s var(--ease) both; }
::view-transition-new(root) { animation: turn-in 0.42s var(--ease) both; }
@keyframes turn-out { to { opacity: 0; transform: translateX(-3%) rotateY(6deg); } }
@keyframes turn-in { from { opacity: 0; transform: translateX(3%) rotateY(-6deg); } }

/* ---------- hero ---------- */
.hero { padding-top: clamp(3rem, 8vw, 6rem); }
.hero h1 { margin-bottom: 0.35em; }
.hero h1 .line { display: block; }
.hero h1 .line--accent { color: var(--accent); font-style: italic; }
.hero .lede { font-size: clamp(1rem, 1.4vw, 1.2rem); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }

/* hero with a full-bleed background image, copy held to the left */
.hero--image {
  position: relative;
  isolation: isolate;
  padding: 0;
  overflow: hidden;
  background: var(--bg-deep);
}
.hero--image .hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
}
/* keeps the left-hand text legible over whatever the photo is doing */
.hero--image .hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--ae-offwhite) 96%, transparent) 0%,
    color-mix(in srgb, var(--ae-offwhite) 90%, transparent) 34%,
    color-mix(in srgb, var(--ae-offwhite) 58%, transparent) 58%,
    color-mix(in srgb, var(--ae-offwhite) 18%, transparent) 82%,
    transparent 100%
  );
}
html[data-theme="dark"] .hero--image .hero-scrim {
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--ae-ink) 96%, transparent) 0%,
    color-mix(in srgb, var(--ae-ink) 90%, transparent) 34%,
    color-mix(in srgb, var(--ae-ink) 62%, transparent) 58%,
    color-mix(in srgb, var(--ae-ink) 24%, transparent) 82%,
    transparent 100%
  );
}
.hero--image .hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: clamp(30rem, 78vh, 46rem);
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}
.hero--image .hero-copy { max-width: 34rem; }
.hero--image h1 { font-size: clamp(2.7rem, 8vw, 5.6rem); }
.hero--image .lede { color: var(--ink); }

@media (max-width: 640px) {
  .hero--image .hero-bg { object-position: 70% 50%; }
  .hero--image .hero-scrim {
    background: linear-gradient(
      to bottom,
      color-mix(in srgb, var(--ae-offwhite) 94%, transparent) 0%,
      color-mix(in srgb, var(--ae-offwhite) 84%, transparent) 62%,
      color-mix(in srgb, var(--ae-offwhite) 62%, transparent) 100%
    );
  }
  html[data-theme="dark"] .hero--image .hero-scrim {
    background: linear-gradient(
      to bottom,
      color-mix(in srgb, var(--ae-ink) 94%, transparent) 0%,
      color-mix(in srgb, var(--ae-ink) 86%, transparent) 62%,
      color-mix(in srgb, var(--ae-ink) 66%, transparent) 100%
    );
  }
}

/* dictated quote signature */
.dictated {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3.2vw, 2.3rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  max-width: 30ch;
  margin: 0 0 1.6rem;
  min-height: 3.2em;
}
.dictated .w {
  display: inline-block;
  opacity: 0;
  filter: blur(6px);
  transform: translateY(0.18em);
  animation: dictate 0.5s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
.dictated .caret {
  display: inline-block;
  width: 0.5ch;
  height: 0.95em;
  margin-left: 0.12em;
  background: var(--accent);
  vertical-align: -0.08em;
  animation: blink 1.05s steps(1, end) infinite;
}
@keyframes dictate {
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---------- lighthouse plate ---------- */
.plate {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--bg-deep);
  overflow: hidden;
}
.plate img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: saturate(0.72) contrast(1.02);
}
.plate figcaption {
  font-family: var(--type);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--rule);
}
.plate--wide img { aspect-ratio: 16 / 10; }

/* the beam — a slow sweep of light across the plate */
.plate--beam::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 38%,
    color-mix(in srgb, var(--ae-mustard) 34%, transparent) 50%,
    transparent 62%
  );
  transform: translateX(-120%);
  animation: sweep 9s var(--ease) infinite;
}
@keyframes sweep {
  0% { transform: translateX(-120%); }
  55%, 100% { transform: translateX(120%); }
}

/* ---------- sections ---------- */
.section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.section-head h2 { margin-bottom: 0.4em; }

/* ---------- services ---------- */
.services { list-style: none; margin: 0; padding: 0; counter-reset: svc; }
.services li {
  counter-increment: svc;
  padding: 1.6rem 0;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 0.4rem 1.5rem;
}
.services li:last-child { border-bottom: 1px solid var(--rule); }
.services li::before {
  content: "0" counter(svc);
  font-family: var(--type);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.services h3 { margin: 0; }
.services p { margin: 0; color: var(--ink-soft); font-size: 0.92em; max-width: 52ch; }
@media (min-width: 720px) {
  .services li { grid-template-columns: 3.5rem minmax(12rem, 18rem) 1fr; align-items: baseline; }
  .services li::before { grid-row: 1; }
  .services h3 { grid-row: 1; }
  .services p { grid-row: 1; }
}

/* ---------- cards / entries ---------- */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .entries--two { grid-template-columns: 1fr 1fr; } }
.entry {
  border: 1px solid var(--rule);
  padding: 1.5rem 1.6rem 1.7rem;
  background: var(--field);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.entry:hover { border-color: var(--accent); transform: translateY(-3px); }
.entry h3 { margin-bottom: 0.5rem; }
.entry p { font-size: 0.92em; color: var(--ink-soft); }
.entry .meta {
  font-family: var(--type);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.7rem;
}

/* ---------- pull quote ---------- */
.pull {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.6vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  max-width: 34ch;
  margin: 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--accent);
}
.pull cite {
  display: block;
  font-family: var(--type);
  font-size: 0.76rem;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 1.1rem;
}

/* ---------- process ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(2, 1fr); } }
.steps li { border-top: 1px solid var(--rule); padding-top: 1.1rem; }
.steps h4 { margin: 0 0 0.45rem; font-family: var(--serif); font-size: 1.15rem; }
.steps p { font-size: 0.9em; color: var(--ink-soft); margin: 0; }
.steps .num {
  font-family: var(--type);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.5rem;
}

/* ---------- facts / definition list ---------- */
.facts { margin: 0; display: grid; gap: 0.9rem; }
.facts div { display: grid; gap: 0.15rem; }
.facts dt {
  font-family: var(--type);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.facts dd { margin: 0; font-size: 0.92em; }

/* ---------- form ---------- */
.form { display: grid; gap: 1.1rem; max-width: 34rem; }
.field { display: grid; gap: 0.4rem; }
.field label {
  font-family: var(--type);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field input, .field select, .field textarea {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--rule);
  padding: 0.8rem 0.9rem;
  min-height: 48px;
  width: 100%;
  transition: border-color 0.25s var(--ease);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.form-status {
  font-family: var(--type);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0;
}

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--rule);
  padding: clamp(2.5rem, 6vw, 4rem) 0 5rem;
  margin-top: clamp(2rem, 5vw, 4rem);
}
.site-foot .wrap { display: grid; gap: 2rem; }
@media (min-width: 760px) { .site-foot .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-foot h4 {
  font-family: var(--type);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-foot a { text-decoration: none; font-size: 0.9rem; }
.site-foot a:hover { color: var(--accent); text-decoration: underline; }
.site-foot .colophon { font-size: 0.82rem; color: var(--ink-soft); max-width: 34ch; }

.attribution {
  position: fixed;
  bottom: 0.5rem;
  right: 0.75rem;
  font-size: 0.7rem;
  opacity: 0.5;
  font-family: var(--mono);
  z-index: 30;
}
.attribution a { color: inherit; }

/* ---------- reveal on scroll (CSS scroll-driven, no JS) ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 8% cover 34%;
    }
    @keyframes rise {
      from { opacity: 0; transform: translateY(22px); }
      to { opacity: 1; transform: none; }
    }
  }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .dictated .w { opacity: 1; filter: none; transform: none; }
  .dictated .caret { display: none; }
  .plate--beam::after { display: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
