/* luckyluker.com — SPEC.md §3–§5 */

/* ---------- Fonts (§4) — self-hosted, latin subset ---------- */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("fonts/BigShouldersDisplay-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ---------- Tokens (§3) ---------- */

:root {
  /* Ground */
  --ink:        #0A0C0D;  /* page background — not pure black */
  --surface:    #12161A;  /* raised panels, portrait frame fill */

  /* Structure */
  --verdigris:  #0F5C5C;  /* deco teal — rules, frames, ornament */
  --verdigris-dim: #0A3D3D;

  /* Accent — used sparingly. If it's everywhere it's not an accent. */
  --teal:       #3FDCC8;

  /* Metal */
  --silver:     #A8B0B8;  /* hairlines, secondary text, labels */
  --silver-dim: #6B747C;

  /* Text */
  --paper:      #E6EAED;  /* body copy */

  /* Type scale (§4) */
  --step--1: clamp(0.78rem, 0.75rem + 0.15vw, 0.86rem);  /* mono labels */
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.13rem);      /* body */
  --step-1:  clamp(1.33rem, 1.2rem + 0.6vw, 1.75rem);
  --step-2:  clamp(1.77rem, 1.5rem + 1.3vw, 2.8rem);     /* section headings */
  --step-3:  clamp(2.4rem, 1.8rem + 3vw, 4.5rem);        /* hero frieze */
  --wordmark: clamp(4rem, 18vw, 11rem);                  /* LUKER */

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body:    "IBM Plex Sans", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  /* Page frame insets — the 12px difference matches the shield's outline/echo gap */
  --f1: 10px;
  --f2: 22px;
}

/* ---------- Base ---------- */

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
}

a {
  color: var(--paper);
  text-decoration-color: var(--silver-dim);
  text-underline-offset: 0.2em;
}
a:hover { color: var(--teal); }

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

/* Mono label voice (§4): uppercase, tracked, dim silver */
.eyebrow,
.jen,
.hero-title,
.seal-sub,
footer {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--silver-dim);
}

.eyebrow {
  font-weight: 400;
  margin: 0 0 1rem;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 clamp(2.5rem, 8vw, 3rem);
}

main section { margin: 5rem 0; }
.about { margin-top: 1rem; }

/* ---------- Page frame (§5.9) ---------- */

.page-frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

/* edge vignette: content fades out as it passes under the frame, so text
   reads only inside the rectangles. Paints under the lines, over the page. */
.page-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, var(--ink), var(--ink) var(--f1), transparent calc(var(--f2) + 14px)),
    linear-gradient(to top,    var(--ink), var(--ink) var(--f1), transparent calc(var(--f2) + 14px)),
    linear-gradient(to right,  var(--ink), var(--ink) var(--f1), transparent calc(var(--f2) + 14px)),
    linear-gradient(to left,   var(--ink), var(--ink) var(--f1), transparent calc(var(--f2) + 14px));
}

/* two interlocked rectangles: one tall, one wide */
.frame-v {
  position: absolute;
  top: var(--f1); bottom: var(--f1);
  left: var(--f2); right: var(--f2);
  border: 1px solid var(--silver);
}
.frame-h {
  position: absolute;
  top: var(--f2); bottom: var(--f2);
  left: var(--f1); right: var(--f1);
  border: 1px solid var(--verdigris);
}

/* the spark: a short teal dash chasing each rectangle's perimeter */
.frame-glint {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 4px var(--teal));
}
.frame-glint rect {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.5;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* dark→light→dark: three dashes of increasing length and falling opacity,
   phase-locked so their centers coincide — reads as one tapered spark */
.g-core { stroke-dasharray: 2 98;     animation-name: glint-core; }
.g-mid  { stroke-dasharray: 4.5 95.5; animation-name: glint-mid;  opacity: 0.45; }
.g-tail { stroke-dasharray: 8 92;     animation-name: glint-tail; opacity: 0.18; }

.glint-a rect {
  x: var(--f2);
  y: var(--f1);
  width: calc(100% - 2 * var(--f2));
  height: calc(100% - 2 * var(--f1));
  animation-duration: 9s;
}
.glint-b rect {
  x: var(--f1);
  y: var(--f2);
  width: calc(100% - 2 * var(--f1));
  height: calc(100% - 2 * var(--f2));
  animation-duration: 11s;
  animation-delay: -5s;
}

/* each layer travels exactly 100 units; the differing start offsets center
   the longer dashes on the core ((L - 2) / 2) */
@keyframes glint-core {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -100; }
}
@keyframes glint-mid {
  from { stroke-dashoffset: 1.25; }
  to   { stroke-dashoffset: -98.75; }
}
@keyframes glint-tail {
  from { stroke-dashoffset: 3; }
  to   { stroke-dashoffset: -97; }
}

@media (max-width: 479px) {
  :root { --f1: 6px; --f2: 16px; }
}

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

/* ---------- Hero (§5.2) ---------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.75rem 1rem;
}

/* auto margins center the pair but collapse instead of clipping
   when the hero is taller than a short viewport */
.hero .shield { margin-top: auto; }
.hero .hero-title { margin-bottom: auto; }

.shield {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* bottom padding reserves the taper-to-point region of the frame */
  /* inline padding must clear the frame sides (11% of the box) at every width */
  padding: clamp(3.5rem, 9vw, 6rem) clamp(2.75rem, 7vw, 5.5rem) clamp(6.5rem, 17vw, 11rem);
}

.shield-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.shield-frame path {
  stroke: var(--silver);
  stroke-width: 1;
  fill: none;
  vector-effect: non-scaling-stroke;
}

.shield-frame .shield-echo { stroke: var(--verdigris); }
.shield-frame .shield-chevron path { stroke: var(--verdigris); }
.shield-frame .shield-simple { display: none; }

@media (max-width: 479px) {
  /* the silhouette simplifies rather than shrinking into mush */
  .shield-frame .shield-full { display: none; }
  .shield-frame .shield-simple { display: block; }
}

.jen {
  margin: 0 0 0.75rem;
  color: var(--silver);
}

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--wordmark);
  line-height: 1;
  letter-spacing: 0.06em;
  text-indent: 0.06em; /* re-center: tracking adds a trailing space */
  text-transform: uppercase;
  color: var(--paper);
}

/* Hairline between wordmark and frieze, teal terminals (accent use 1 of 4) */
.hero-rule {
  width: 100%;
  height: 1px;
  background: var(--silver);
  margin: clamp(1.25rem, 3vw, 2rem) 0;
  position: relative;
}
.hero-rule::before,
.hero-rule::after {
  content: "";
  position: absolute;
  top: -2px;
  width: 5px;
  height: 5px;
  background: var(--teal);
}
.hero-rule::before { left: 0; }
.hero-rule::after { right: 0; }

.frieze {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  /* vw cap keeps HYPERVIGILANCE inside the frame on narrow phones */
  font-size: min(var(--step-3), 6.5vw);
  line-height: 1.15;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  color: var(--paper);
}
.frieze span { display: block; }

.hero-title {
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  color: var(--silver);
  line-height: 2;
}
.hero-title span { display: block; }

/* ---------- The seal (§5.4) ---------- */

.seal-band {
  position: relative;
  width: 100vw;
  margin: 6rem calc(50% - 50vw);
  display: flex;
  justify-content: center;
}

/* the frieze: hairline rules from the viewport edges, interrupted at the axis */
.seal-band::before,
.seal-band::after {
  content: "";
  position: absolute;
  top: 117px; /* vertical midpoint of the 180px-wide medallion (h = w × 520/400 / 2) */
  height: 1px;
  background: var(--silver-dim);
}
.seal-band::before { left: 0; right: calc(50% + 104px); }
.seal-band::after  { right: 0; left: calc(50% + 104px); }

.seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.seal-shield {
  width: 180px;
  height: auto;
}
.seal-shield path {
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.seal-shield .seal-ground {
  fill: var(--verdigris-dim);
  stroke: var(--silver);
}
/* one of the four permitted uses of --teal: a single hairline inside the outer step */
.seal-shield .seal-inner {
  fill: none;
  stroke: var(--teal);
}
.seal-shield .seal-chevron path {
  fill: none;
  stroke: var(--silver);
}
.seal-shield text {
  font-family: var(--display);
  font-weight: 600;
  font-size: 46px;
  letter-spacing: 3px;
  text-anchor: middle;
  fill: var(--paper);
}

.seal-sub {
  margin: 1.25rem 0 0;
  letter-spacing: 0.18em;
  color: var(--silver);
}

.seal-year {
  margin: 0.4rem 0 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: var(--step-0);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: var(--silver);
}

@media (max-width: 479px) {
  /* the seal scales down; the rules shorten but the interruption remains */
  .seal-shield { width: 130px; }
  .seal-band::before, .seal-band::after { top: 84px; }
  .seal-band::before { right: calc(50% + 79px); }
  .seal-band::after  { left: calc(50% + 79px); }
}

/* ---------- Interim readability for later-step sections ---------- */
/* Styled properly in steps 4–6; kept legible, not designed, until then. */

.portrait-slot { display: none; /* §2.8 — slot reserved, page finished without it */ }

.playbill, .expertise-frieze {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------- Playbill (§5.6, amended: no numbering, centered) ---------- */

.work { text-align: center; }
.work .eyebrow { margin-bottom: 0; }

.playbill a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1.75rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid var(--verdigris-dim);
  transition: border-color 150ms;
}
.playbill a:hover,
.playbill a:focus-visible {
  border-color: var(--teal);
  color: inherit;
}

.row-icon {
  width: 26px;
  height: auto;
  stroke: var(--silver);
  stroke-width: 1.2;
  fill: none;
  margin-bottom: 0.35rem;
}

.row-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
}

.row-sub { color: var(--silver); }

.row-meta {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--silver-dim);
  margin-top: 0.35rem;
}

/* ---------- Secondary links (§5.7, amended: teal marks) ---------- */

.links-secondary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.25rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.links { margin-top: 2rem; margin-bottom: 1rem; }

.links-secondary a {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: 44px;
  color: var(--silver);
  text-decoration: none;
  transition: color 150ms;
}
.links-secondary a:hover,
.links-secondary a:focus-visible { color: var(--teal); }

.icon-social {
  width: 17px;
  height: 17px;
  fill: var(--teal);
}

.links-secondary .sep {
  color: var(--silver-dim);
}

@media (max-width: 479px) {
  /* when wrapping is unavoidable, drop the separators rather than strand one at a line end */
  .links-secondary .sep { display: none; }
}

.expertise-frieze {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  gap: 0.5rem 1.5rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--silver);
}

footer {
  text-align: center;
  padding: 2.5rem 2.5rem 4rem;
  line-height: 2.2;
}
footer a { color: var(--silver); }

/* ---------- Motion guard (§6) ---------- */

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