/* styles.css — flagbearer.org. Consumes design-tokens.css.
   v2 (2026-09-01): Kraken-system structure, Flagbearer colors. */

/* ---- Fonts (self-hosted, variable, latin) ---- */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Reset-lite ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
img { max-width: 100%; display: block; height: auto; }

body {
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--page-max); margin: 0 auto; padding-inline: var(--page-pad); }

h1, h2, h3 {
  font-family: var(--font-display); color: var(--ink);
  line-height: var(--leading-display); font-weight: 700;
  letter-spacing: var(--track-display);
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--ink); color: var(--canvas); padding: 0.5rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---- Header ---- */
.site-header { border-bottom: 1px solid var(--hairline); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex; align-items: flex-end;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  letter-spacing: -0.01em; line-height: 1;
  color: var(--ink); text-decoration: none;
}
/* The mark IS the F: glyph on the wordmark baseline, "lagbearer" completes the word */
.brand .brand-f { width: 13px; height: 21px; display: block; margin: 0 -3px 3.5px 0; }
/* Roundel variant: F-in-circle; the wordmark baseline aligns to the F inside, not the circle */
.brand .brand-roundel { width: 24px; height: 24px; margin: 0 1px 2px 0; }
.brand .brand-roundel + span { margin-bottom: 3px; }
.site-nav { display: flex; gap: 0.25rem; }
.site-nav a {
  color: var(--body); text-decoration: none; font-size: var(--text-small); font-weight: 500;
  padding: 0.75rem 0.7rem; border-radius: var(--radius);
}
.site-nav a:hover { color: var(--ink); background: var(--canvas-soft); }

/* ---- Hero: a soft rounded panel anchors the page ---- */
.hero { padding-block: clamp(1.25rem, 3vw, 2rem) var(--space-section); }
.hero .wrap {
  position: relative;
  background: var(--canvas-soft);
  border-radius: var(--radius-card);
  padding-block: clamp(2rem, 4vw, 3rem) clamp(2.75rem, 5.5vw, 4.25rem);
}
.hero h1, .hero p, .hero .cta-row { position: relative; z-index: 1; }
/* Deck: in-flow below the copy on small screens, floating right inside the panel on wide ones */
.hero-visual {
  position: relative; width: min(100%, 420px); aspect-ratio: 1.3;
  margin: 2.25rem auto 0;
  pointer-events: none; z-index: 0;
}
@media (min-width: 920px) {
  .hero-visual {
    /* top 45%, not 50%: the deck's mass hangs from its bottom edge, so true
       optical centering needs the container to ride slightly high */
    position: absolute; top: 45%; right: var(--page-pad); transform: translateY(-50%);
    width: min(44%, 520px); margin: 0;
  }
}
.hero-card {
  position: absolute; left: 0; right: 0; bottom: 0; margin-inline: auto;
  width: 88%; aspect-ratio: 1280 / 860;
  border: 1px solid var(--hairline); border-radius: var(--radius-card);
  overflow: hidden; background: var(--canvas-soft); box-shadow: var(--shadow-subtle);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease;
}
.hero-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-card.pos-0 { transform: none; opacity: 1; z-index: 3; }
.hero-card.pos-1 { transform: translate(6%, -10%) scale(0.95); opacity: 0.6; z-index: 2; }
.hero-card.pos-2 { transform: translate(12%, -20%) scale(0.9); opacity: 0.32; z-index: 1; }
/* Fourth deck slot: parked invisibly behind the stack, fades in when promoted to pos-2 */
.hero-card.pos-3 { transform: translate(12%, -20%) scale(0.88); opacity: 0; z-index: 0; }
/* Deck shuffle, phase one: the front card slides out to the lower left at FULL
   opacity (it only fades once the class swap sends it behind the stack). */
.hero-card.leaving {
  transform: translate(-16%, 9%) scale(0.97); opacity: 1;
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.6, 1), opacity 0.42s ease;
}
.hero h1 {
  font-size: var(--text-hero);
  max-width: 24ch; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p {
  margin-top: 1.25rem; max-width: 46ch; font-size: 1.125rem; line-height: 1.45;
}
.hero .cta-row { margin-top: 2rem; }

.btn {
  display: inline-block; font-family: var(--font-body); font-weight: 600;
  font-size: 1rem; line-height: 1.38; text-decoration: none; cursor: pointer;
  border-radius: var(--radius-btn); border: 1px solid transparent;
  padding: 13px 16px; white-space: nowrap;
  transition: transform 0.12s ease, background-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-bg); color: var(--on-accent); }
.btn-primary:hover { background: var(--btn-bg-hover); color: var(--on-accent); }

/* ---- Badges (Kraken system) ---- */
.status {
  display: inline-block; margin-top: 0.6rem;
  font-size: var(--text-small); font-weight: 500; line-height: 1.4;
  padding: 3px 10px; border-radius: var(--radius-badge);
  text-decoration: none;
}
.status.live { background: var(--success-wash); color: var(--success-text); }
.status.dev { background: var(--neutral-badge-wash); color: var(--neutral-badge-text); }

/* ---- Projects (editorial index, carded shots) ---- */
.projects { padding-bottom: var(--space-section); }
.projects h2 { font-size: var(--text-h2); margin-bottom: 0.75rem; }
.projects > .wrap > p { max-width: var(--measure); }
.project-list { margin-top: 2.5rem; }
.project {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
  border-top: 1px solid var(--hairline); padding-block: clamp(2rem, 5vw, 3.25rem);
}
.project h3 { font-size: var(--text-h3); font-weight: 600; letter-spacing: normal; line-height: 1.2; }
.project p.desc { margin-top: 1rem; max-width: 48ch; }
/* The whole text column is one quiet click target: a ghost surface that only
   shows itself on hover, spanning the title, badge, description, and the
   whitespace around them. */
.project-info {
  display: block; position: relative; text-decoration: none; color: var(--body);
  margin: -1.25rem; padding: 1.25rem;
  border-radius: var(--radius-card);
  transition: background-color 0.15s ease;
}
.project-info:hover { background: var(--canvas-soft); color: var(--body); }
/* Thick outbound arrow, revealed in the surface's top-right on hover */
.project-info .go {
  position: absolute; top: 1.1rem; right: 1.1rem;
  width: 22px; height: 22px; color: var(--muted);
  opacity: 0; transform: translate(-4px, 4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.project-info .go svg { width: 100%; height: 100%; display: block; }
.project-info:hover .go { opacity: 1; transform: none; }
.project .shot {
  display: block;
  border: 1px solid var(--hairline); border-radius: var(--radius-card); overflow: hidden;
  background: var(--canvas-soft); box-shadow: var(--shadow-subtle);
}
/* Screenshot doubles as the outbound link: quiet lift on hover */
a.shot { transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
a.shot:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-hover); }
.project .shot img { width: 100%; }

/* ---- Mission ---- */
.mission { background: var(--canvas-soft); border-block: 1px solid var(--hairline); padding-block: var(--space-section); }
.mission h2 { font-size: var(--text-h2); }
.mission .prose { max-width: var(--measure); margin-top: 1.5rem; }
.mission .prose p + p { margin-top: 1.25rem; }

/* ---- Contact ---- */
.contact { padding-block: var(--space-section); }
.contact .wrap {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 6vw, 5rem); align-items: start;
}
.contact h2 { font-size: var(--text-h2); }
.contact .lede { margin-top: 1.25rem; max-width: 40ch; }
.contact form { display: grid; gap: 1.25rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; font-size: var(--text-small); color: var(--ink); }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: var(--canvas-soft);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 0.75rem 0.9rem; width: 100%;
}
.field input:focus, .field textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent);
}
.field textarea { min-height: 9rem; resize: vertical; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.form-status { font-size: var(--text-small); min-height: 1.5em; }
.form-status.error { color: var(--accent); font-weight: 600; }
.form-status.ok { color: var(--ink); font-weight: 600; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--hairline); padding-block: 2.5rem; }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: baseline; justify-content: space-between;
  font-size: var(--text-small); color: var(--muted);
}
.site-footer nav { display: flex; gap: 1.5rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---- Mobile collapse ---- */
@media (max-width: 767px) {
  .site-nav { gap: 0; }
  .project { grid-template-columns: 1fr; align-items: start; }
  .project .shot { order: 2; }
  .contact .wrap { grid-template-columns: 1fr; }
}
