/* ==========================================================================
   Forgeline Enterprises — site styles
   ========================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #08090a;
  --bg-raise: #0e0f11;
  --bg-card: #0c0d0f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #6b6b74;
  --accent: #e8e6e1;
  --ember: #ff6a2b; /* single warm accent — the "forge" */

  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(20px, 4vw, 56px);
  --max: 1320px;
  --section: clamp(96px, 14vw, 200px);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reset ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--text); color: var(--bg); }

:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 4px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 12px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Grain overlay — keeps flat blacks from banding */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Header ----------------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(8, 9, 10, 0.72);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.32em;
}
.header-inner .wordmark { position: relative; z-index: 60; }
.wordmark .mark { width: 18px; height: 18px; }
.wordmark span { margin-right: -0.32em; }

.nav-menu { display: flex; align-items: center; gap: 36px; }
.nav-menu a {
  position: relative;
  font-size: 14px; color: var(--text-2);
  transition: color 0.25s var(--ease);
}
.nav-menu a:hover, .nav-menu a[aria-current="true"] { color: var(--text); }
.nav-menu a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav-menu a:not(.nav-cta):hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta {
  padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--text) !important;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease) !important;
}
.nav-cta:hover { background: var(--text); color: var(--bg) !important; border-color: var(--text); }

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle {
    position: relative; z-index: 60;
    display: grid; place-content: center; gap: 6px;
    width: 44px; height: 44px; margin-right: -10px;
  }
  .nav-toggle-bar {
    display: block; width: 22px; height: 1.5px; background: var(--text);
    transition: transform 0.35s var(--ease);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { transform: translateY(3.75px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-3.75px) rotate(-45deg); }

  .nav-menu {
    position: fixed; inset: 0; z-index: 55;
    flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 8px; padding: 0 var(--gutter);
    background: rgba(8, 9, 10, 0.97);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0s linear 0.35s;
  }
  .nav-menu.is-open { opacity: 1; visibility: visible; transition: opacity 0.35s var(--ease); }
  .nav-menu a, .nav-cta {
    font-size: clamp(36px, 11vw, 56px); font-weight: 500; letter-spacing: -0.03em;
    line-height: 1.15; color: var(--text) !important;
    padding: 0; border: 0;
  }
  .nav-cta:hover { background: none; }
  .nav-menu a::after { display: none; }
  .nav-menu li { opacity: 0; transform: translateY(12px); transition: opacity 0.4s var(--ease), transform 0.5s var(--ease); }
  .nav-menu.is-open li { opacity: 1; transform: none; }
  .nav-menu.is-open li:nth-child(2) { transition-delay: 0.05s; }
  .nav-menu.is-open li:nth-child(3) { transition-delay: 0.1s; }
  .nav-menu.is-open li:nth-child(4) { transition-delay: 0.15s; }
  body.nav-open { overflow: hidden; }
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 26px;
  border-radius: 999px;
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn svg { width: 16px; height: 16px; transition: transform 0.35s var(--ease); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08); }
.btn-primary:hover svg { transform: translateY(3px); }
.btn:active { transform: scale(0.98); }

/* Hero ------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 120px; padding-bottom: 40px;
  overflow: hidden;
  isolation: isolate;
}
.hero-canvas {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
}
.hero-glow {
  position: absolute; z-index: -1; pointer-events: none;
  left: 50%; bottom: -30%;
  width: 140vw; height: 80vh; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 106, 43, 0.10), rgba(255, 106, 43, 0.03) 50%, transparent 75%);
}
.hero::after {
  /* fade the field into the page */
  content: ""; position: absolute; inset: auto 0 0 0; height: 30%; z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.hero-inner { position: relative; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: clamp(28px, 4vw, 40px);
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-2);
}
.dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ember);
  box-shadow: 0 0 0 0 rgba(255, 106, 43, 0.6);
  animation: pulse 2.8s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 106, 43, 0.5); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(255, 106, 43, 0); }
}

.hero-title {
  font-size: clamp(56px, 11.5vw, 184px);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.055em;
  margin-left: -0.04em;
}
.hero-title .line { display: block; }
.hero-title .line:last-child {
  background: linear-gradient(180deg, #ffffff 10%, #8d8d96 95%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-bottom: 0.06em;
}
.hero-copy {
  max-width: 34em;
  margin-top: clamp(28px, 4vw, 44px);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
  color: var(--text-2);
  letter-spacing: -0.01em;
}
.hero-actions { margin-top: clamp(32px, 4vw, 48px); }

.hero-index {
  display: flex; gap: clamp(20px, 4vw, 56px); flex-wrap: wrap;
  margin-top: auto; padding-top: clamp(56px, 8vw, 96px);
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3);
}
.hero-index b { font-family: var(--mono); font-weight: 400; color: var(--text-2); margin-right: 8px; }

/* Sections --------------------------------------------------------------- */
.section { position: relative; padding-block: var(--section); }
.section + .section { border-top: 1px solid var(--line); }

.section-label {
  display: inline-flex; gap: 10px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-3);
}
.section-label span { font-family: var(--mono); letter-spacing: 0; color: var(--text-2); }

.section-title {
  font-size: clamp(40px, 6vw, 88px);
  font-weight: 600; line-height: 0.98; letter-spacing: -0.045em;
  text-wrap: balance;
}
.lead {
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.45; letter-spacing: -0.02em; color: var(--text);
}

/* About */
.split {
  display: grid; grid-template-columns: minmax(160px, 1fr) 3fr; gap: 48px;
}
.split .section-label { padding-top: 0.9em; align-self: start; }
.about-copy {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 5vw, 72px);
  margin-top: clamp(40px, 6vw, 80px);
}
.about-copy p:not(.lead) { color: var(--text-2); padding-top: 0.35em; }

.facts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: clamp(56px, 8vw, 104px);
  border-top: 1px solid var(--line);
}
.facts > div { padding: 22px 24px 0 0; }
.facts > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.facts dt { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.facts dd { font-size: 15px; color: var(--text); }

/* Focus cards */
.section-head {
  display: grid; grid-template-columns: minmax(160px, 1fr) 3fr; gap: 48px;
  margin-bottom: clamp(56px, 8vw, 96px);
}
.section-head .section-label { padding-top: 0.9em; align-self: start; }
.focus .section-title { max-width: 12em; }

.cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card {
  --mx: 50%; --my: 0%;
  position: relative;
  display: flex; flex-direction: column;
  min-height: 440px;
  padding: clamp(28px, 3vw, 40px);
  background: var(--bg-card);
  transition: background-color 0.5s var(--ease);
  isolation: isolate;
}
.card::before {
  /* cursor-tracked light */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.06), transparent 60%);
  opacity: 0; transition: opacity 0.5s var(--ease);
}
.card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--ember), transparent);
  transform: scaleX(0); transition: transform 0.7s var(--ease);
  opacity: 0.8;
}
.card:hover { background: var(--bg-raise); }
.card:hover::before { opacity: 1; }
.card:hover::after { transform: scaleX(1); }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.card-num { font-family: var(--mono); font-size: 13px; color: var(--text-3); }
.card-icon {
  width: 40px; height: 40px; color: var(--text-2);
  stroke-width: 1;
  transition: color 0.4s var(--ease), transform 0.6s var(--ease);
}
.card-icon * { vector-effect: non-scaling-stroke; }
.card:hover .card-icon { color: var(--text); transform: rotate(-6deg) scale(1.04); }

.card-title {
  margin-top: auto;
  font-size: clamp(26px, 2.4vw, 34px); font-weight: 600;
  line-height: 1.05; letter-spacing: -0.035em;
}
.card-copy {
  margin-top: 16px; max-width: 26em;
  font-size: 15.5px; line-height: 1.6; color: var(--text-2);
}

/* Philosophy */
.philosophy { overflow: hidden; }
.philosophy::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%,
    radial-gradient(60% 50% at 80% 30%, rgba(255, 255, 255, 0.035), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
  opacity: 0.6;
}
.mega {
  margin-top: clamp(32px, 5vw, 64px);
  font-size: clamp(52px, 10.5vw, 176px);
  font-weight: 600; line-height: 0.9; letter-spacing: -0.06em;
  margin-left: -0.05em;
}
.mega .line { display: block; }
.mega .muted { color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.5); }
.philosophy-foot {
  display: grid; grid-template-columns: minmax(160px, 1fr) 3fr; gap: 48px;
  margin-top: clamp(56px, 8vw, 112px);
}
.philosophy-foot .lead { grid-column: 2; max-width: 28em; color: var(--text-2); }
.philosophy-foot .lead::first-line { color: var(--text); }
.principles {
  grid-column: 2;
  display: flex; flex-wrap: wrap; gap: 12px;
}
.principles li {
  display: inline-flex; gap: 10px; align-items: baseline;
  padding: 10px 18px; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 14px; color: var(--text);
}
.principles span { font-family: var(--mono); font-size: 12px; color: var(--text-3); }

/* Contact */
.contact { padding-bottom: clamp(96px, 12vw, 160px); }
.contact-title { max-width: 9em; }
.contact-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px;
  margin-top: clamp(48px, 7vw, 96px);
  padding-top: 32px; border-top: 1px solid var(--line);
}
.contact-note { color: var(--text-2); max-width: 22em; }
.contact-email {
  position: relative;
  display: inline-flex; align-items: center; gap: 16px;
  font-size: clamp(24px, 3.4vw, 48px); font-weight: 500; letter-spacing: -0.035em;
  line-height: 1.1; padding-bottom: 8px;
  overflow-wrap: anywhere;
}
.contact-email::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--line-strong);
}
.contact-email::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; z-index: 1;
  background: var(--text); transform: scaleX(0); transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.contact-email:hover::before { transform: scaleX(1); }
.contact-email svg { flex: none; width: 0.8em; height: 0.8em; transition: transform 0.45s var(--ease); }
.contact-email:hover svg { transform: translate(4px, -4px); }

/* Footer ----------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px; }
.footer-inner {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 32px 56px;
}
.footer-meta { display: flex; gap: 32px; font-size: 13px; color: var(--text-3); }
.footer-links { display: flex; gap: 24px; font-size: 13px; }
.footer-links a { color: var(--text-2); transition: color 0.25s var(--ease); }
.footer-links a:hover { color: var(--text); }

/* Reveal animation ------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1024px) {
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .card-title { margin-top: 72px; }
  .about-copy { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .split, .section-head, .philosophy-foot { grid-template-columns: 1fr; gap: 24px; }
  .philosophy-foot .lead, .principles { grid-column: 1; }
  .split .section-label, .section-head .section-label { padding-top: 0; }
  .facts { grid-template-columns: 1fr; }
  .facts > div, .facts > div + div { padding: 18px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .hero-index { flex-direction: column; gap: 10px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .footer-meta { flex-direction: column; gap: 4px; }
  .mega .muted { -webkit-text-stroke-width: 0.75px; }
}

/* 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;
    transition-delay: 0s !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Legal pages
   ========================================================================== */
.legal-page { padding-top: 160px; padding-bottom: var(--section); }
.legal-wrap {
  display: grid; grid-template-columns: minmax(180px, 1fr) 3fr; gap: 48px;
}
.legal-aside { position: sticky; top: 110px; align-self: start; }
.legal-aside .section-label { margin-bottom: 20px; }
.legal-toc { display: grid; gap: 8px; font-size: 13.5px; }
.legal-toc a { color: var(--text-3); transition: color 0.2s var(--ease); }
.legal-toc a:hover { color: var(--text); }

.legal-title {
  font-size: clamp(44px, 7vw, 96px); font-weight: 600;
  line-height: 0.95; letter-spacing: -0.05em;
}
.legal-updated { margin-top: 20px; font-size: 14px; color: var(--text-3); }
.legal-body { max-width: 44em; margin-top: clamp(48px, 6vw, 80px); }
.legal-body section { padding-top: 40px; margin-top: 40px; border-top: 1px solid var(--line); scroll-margin-top: 96px; }
.legal-body section:first-child { margin-top: 0; }
.legal-body h2 {
  display: flex; gap: 14px; align-items: baseline;
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 16px;
}
.legal-body h2 span { font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--text-3); }
.legal-body p, .legal-body li { color: var(--text-2); font-size: 16px; }
.legal-body p + p, .legal-body p + ul, .legal-body ul + p { margin-top: 14px; }
.legal-body ul { display: grid; gap: 8px; padding-left: 0; }
.legal-body ul li { position: relative; padding-left: 20px; }
.legal-body ul li::before {
  content: ""; position: absolute; left: 0; top: 0.8em; width: 8px; height: 1px; background: var(--text-3);
}
.legal-body a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.legal-body a:hover { text-decoration-color: var(--text); }
.legal-body strong { color: var(--text); font-weight: 500; }

/* Visible marker for text the owner must finalize before launch */
.todo {
  display: block;
  margin-top: 16px; padding: 14px 16px;
  border: 1px dashed rgba(255, 106, 43, 0.45); border-radius: 10px;
  background: rgba(255, 106, 43, 0.05);
  font-size: 14px; line-height: 1.5; color: #ffb48f;
}
.todo::before { content: "To finalize — "; font-weight: 600; color: var(--ember); }
mark.fill {
  background: rgba(255, 106, 43, 0.12); color: #ffb48f;
  padding: 1px 6px; border-radius: 4px; font-size: 0.95em;
}

@media (max-width: 860px) {
  .legal-wrap { grid-template-columns: 1fr; }
  .legal-aside { position: static; }
  .legal-toc { display: none; }
  .legal-page { padding-top: 120px; }
}

/* 404 */
.notfound {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
}
.notfound p { margin-top: 24px; color: var(--text-2); }
.notfound .btn { margin-top: 40px; align-self: flex-start; }

/* Legal-page header keeps a single inline link on mobile */
@media (max-width: 760px) {
  .nav-menu--static {
    position: static; flex-direction: row; padding: 0;
    background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    opacity: 1; visibility: visible;
  }
  .nav-menu--static li { opacity: 1; transform: none; }
  .nav-menu--static .nav-cta {
    font-size: 14px; font-weight: 400; letter-spacing: 0; line-height: 1.6;
    padding: 8px 16px; border: 1px solid var(--line-strong);
  }
}
