/* ============================================================
   Foundry 88 Labs — site styles
   Dark, industrial, molten-forge identity
   ============================================================ */

:root {
  /* Core palette */
  --ink:        #06060a;   /* deepest background */
  --coal:       #0b0c11;   /* base background */
  --panel:      #111319;   /* raised surfaces */
  --panel-2:    #161922;   /* cards */
  --steel:      #2a2f3a;   /* borders / lines */
  --steel-soft: #1b1f29;

  --text:       #eef0f4;   /* primary text */
  --muted:      #9aa1b0;   /* secondary text */
  --dim:        #656c7d;   /* tertiary text */

  /* Molten accent */
  --ember:      #ff6a1a;
  --ember-hot:  #ffb347;
  --ember-deep: #e8341c;
  --molten:     linear-gradient(100deg, #ffb347 0%, #ff6a1a 45%, #e8341c 100%);

  --radius:     14px;
  --radius-sm:  10px;
  --maxw:       1180px;

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

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

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--coal);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--ember); color: #0a0a0a; }

/* ---------- Ambient background ---------- */
.bg-grid,
.bg-glow,
.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
}
.bg-glow {
  background:
    radial-gradient(600px 400px at 15% -5%, rgba(255,106,26,0.16), transparent 70%),
    radial-gradient(700px 500px at 90% 8%, rgba(232,52,28,0.10), transparent 70%),
    radial-gradient(900px 700px at 50% 120%, rgba(255,179,71,0.05), transparent 70%);
}
.bg-noise {
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.028'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- Layout helpers ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px 32px;
}
.section-head { max-width: 760px; margin-bottom: 56px; }
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 18px;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.section-sub { color: var(--muted); margin-top: 18px; font-size: 1.05rem; }
.under {
  position: relative;
  white-space: nowrap;
}
.under::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.32em;
  background: var(--molten);
  opacity: 0.35;
  z-index: -1;
  border-radius: 2px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 32px;
  backdrop-filter: blur(2px);
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(6,6,10,0.85), rgba(6,6,10,0));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}
.nav.scrolled::before { opacity: 1; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  filter: drop-shadow(0 4px 14px rgba(255,106,26,0.35));
  transition: transform 0.4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.brand-text.small { font-size: 1.1rem; }
.brand-88 {
  background: var(--molten);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62em;
  color: var(--dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-left: 6px;
  align-self: center;
}

.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--molten);
  transition: width 0.28s var(--ease);
}
.nav-links a:not(.nav-cta):hover { color: var(--text); }
.nav-links a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
  padding: 9px 20px;
  border: 1px solid var(--steel);
  border-radius: 100px;
  color: var(--text) !important;
  transition: all 0.25s var(--ease);
}
.nav-cta:hover {
  border-color: var(--ember);
  box-shadow: 0 0 24px rgba(255,106,26,0.25);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 26px; height: 2px;
  background: var(--text);
  transition: 0.3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 14px 26px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.28s var(--ease);
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--molten);
  color: #14060a;
  box-shadow: 0 8px 30px rgba(255,106,26,0.28);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 44px rgba(255,106,26,0.45);
}
.btn-primary .arr { transition: transform 0.28s var(--ease); }
.btn-primary:hover .arr { transform: translateX(4px); }
.btn-ghost {
  border-color: var(--steel);
  color: var(--text);
  background: rgba(255,255,255,0.02);
}
.btn-ghost:hover { border-color: var(--ember); background: rgba(255,106,26,0.06); }
.btn-lg { padding: 18px 34px; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 90px 32px 70px;
}
.hero-inner { max-width: 880px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding: 8px 16px;
  border: 1px solid var(--steel);
  border-radius: 100px;
  background: rgba(255,255,255,0.02);
  margin-bottom: 30px;
}
.spark {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 10px 2px rgba(255,106,26,0.7);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}
.molten {
  background: var(--molten);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
}
.hero-lede {
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 40px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 72px; }

.hero-stats {
  display: flex;
  gap: 64px;
  list-style: none;
  flex-wrap: wrap;
  padding-top: 40px;
  border-top: 1px solid var(--steel-soft);
}
.hero-stats li { display: flex; flex-direction: column; }
/* Keep the number and its suffix (e.g. 100 + %) together on one line */
.stat-value { display: inline-flex; align-items: baseline; white-space: nowrap; }
.hero-stats .num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  background: var(--molten);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline;
}
.hero-stats .suffix {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ember);
  margin-left: 2px;
  transform: translateY(-0.55em);
}
.hero-stats .pmark { font-size: 2.6rem; }
.hero-stats .lbl {
  font-size: 0.85rem;
  color: var(--dim);
  margin-top: 8px;
  letter-spacing: 0.01em;
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--steel-soft);
  border-bottom: 1px solid var(--steel-soft);
  padding: 22px 0;
  background: rgba(0,0,0,0.25);
}
.marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: scroll 80s linear infinite;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  color: var(--dim);
}
.marquee-group {
  display: flex;
  align-items: center;
  white-space: nowrap;
}
/* Spacing lives inside the items (as margins) so the gap between the two
   groups is identical to the gap everywhere else — that makes the -50%
   loop land exactly at the seam, with no jump. */
.marquee-group > span { margin: 0 20px; }
.marquee-track .dot { color: var(--ember); font-size: 0.9rem; }
@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Studio ---------- */
.studio-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: start;
}
.studio-lede p { color: var(--muted); font-size: 1.08rem; margin-bottom: 20px; }
.studio-lede p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  float: left;
  line-height: 0.8;
  padding: 6px 12px 0 0;
  background: var(--molten);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.studio-values { list-style: none; display: flex; flex-direction: column; gap: 20px; }
.studio-values li {
  padding: 24px;
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.studio-values li:hover { border-color: var(--ember); transform: translateX(6px); }
.val-ic {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,106,26,0.1);
  color: var(--ember);
  font-size: 1.2rem;
  margin-bottom: 14px;
}
.studio-values h3 { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 6px; }
.studio-values p { color: var(--muted); font-size: 0.96rem; }

/* ---------- Work / Apps ---------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}
.app-card {
  position: relative;
  padding: 30px;
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s;
  isolation: isolate;
}
.app-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent, var(--ember));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.app-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 200px at 50% -20%, color-mix(in srgb, var(--accent, #ff6a1a) 14%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  z-index: -1;
}
.app-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent, #ff6a1a) 55%, var(--steel)); }
.app-card:hover::before { transform: scaleX(1); }
.app-card:hover::after { opacity: 1; }

.app-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.app-glyph {
  display: inline-grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent, #ff6a1a) 14%, transparent);
  color: var(--accent, var(--ember));
  font-size: 1.35rem;
  border: 1px solid color-mix(in srgb, var(--accent, #ff6a1a) 30%, transparent);
}
.app-status {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 100px;
  border: 1px solid var(--steel);
  color: var(--muted);
}
.app-status.live { color: #3ddc84; border-color: rgba(61,220,132,0.3); background: rgba(61,220,132,0.06); }
.app-status.build { color: var(--ember-hot); border-color: rgba(255,179,71,0.3); background: rgba(255,179,71,0.06); }
.app-status.soon { color: var(--dim); }

.app-card h3 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 6px; letter-spacing: -0.01em; }
.app-cat {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--dim);
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}
.app-desc { color: var(--muted); font-size: 0.97rem; margin-bottom: 20px; }
.app-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.app-tags li {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--steel-soft);
}
.app-card--soon {
  border-style: dashed;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.app-card--soon .app-glyph { background: rgba(255,255,255,0.03); color: var(--muted); border-color: var(--steel); }

/* ---------- Approach ---------- */
.process {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  counter-reset: step;
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.process li {
  padding: 34px 28px;
  border-right: 1px solid var(--steel);
  position: relative;
  transition: background 0.3s;
}
.process li:last-child { border-right: none; }
.process li:hover { background: rgba(255,106,26,0.04); }
.step-no {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ember);
  letter-spacing: 0.1em;
}
.process h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 16px 0 10px;
}
.process p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Contact ---------- */
.contact { padding-top: 40px; }
.contact-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 64px;
  border: 1px solid var(--steel);
  border-radius: 24px;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(255,106,26,0.14), transparent 60%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: "";
  position: absolute;
  top: -40%; right: -10%;
  width: 380px; height: 380px;
  background: var(--molten);
  filter: blur(120px);
  opacity: 0.18;
  border-radius: 50%;
}
.contact-copy h2 { margin: 16px 0 18px; }
.contact-copy p { color: var(--muted); max-width: 420px; }
.contact-actions { text-align: left; }
.contact-actions .btn { word-break: break-all; }
.contact-note { color: var(--dim); font-size: 0.85rem; margin-top: 14px; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 60px 32px 40px;
  border-top: 1px solid var(--steel-soft);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.footer-brand { max-width: 320px; }
.footer-brand p { color: var(--dim); font-size: 0.9rem; margin-top: 12px; }
.footer-nav { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; }
.footer-nav a { color: var(--muted); font-size: 0.92rem; transition: color 0.2s; }
.footer-nav a:hover { color: var(--ember); }
.footer-legal {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--steel-soft);
  font-size: 0.82rem;
  color: var(--dim);
  font-family: var(--font-mono);
}
.forged { color: var(--muted); }

/* ---------- Reveal animation ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .studio-grid { grid-template-columns: 1fr; gap: 40px; }
  .process { grid-template-columns: repeat(2, 1fr); }
  .process li:nth-child(2) { border-right: none; }
  .process li:nth-child(1), .process li:nth-child(2) { border-bottom: 1px solid var(--steel); }
  .contact-card { grid-template-columns: 1fr; padding: 40px; }
}

@media (max-width: 720px) {
  .section { padding: 80px 22px; }
  .hero { padding: 60px 22px 50px; }
  .nav { padding: 16px 22px; }
  .nav-links {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--ink);
    border-bottom: 1px solid var(--steel);
    padding: 8px 0;
    transform: translateY(-140%);
    transition: transform 0.4s var(--ease);
    z-index: 40;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 16px 24px; width: 100%; border-bottom: 1px solid var(--steel-soft); }
  .nav-links .nav-cta { border: none; border-radius: 0; }
  .nav-toggle { display: flex; }
  .hero-stats { gap: 32px; }
  .hero-stats .num, .hero-stats .pmark { font-size: 2.1rem; }
  .process { grid-template-columns: 1fr; }
  .process li { border-right: none; border-bottom: 1px solid var(--steel); }
  .process li:last-child { border-bottom: none; }
  .footer-legal { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; }
}
