/* Genesis Forge Studio. Square iron, one molten bar, a chamfered corner.
   Layout runs on the 8-unit grid the mark is cut on. */
:root {
  --molten: #ff5f1f;
  --on-molten: #14161b;
  --molten-ink: #b83a0b;
  --molten-soft: #ffe4d8;
  --ember: #ffb020;
  --quench: #2f5f8f;
  --quench-soft: #dfe9f4;
  --anvil: #14161b;
  --on-anvil: #eef0f3;
  --on-anvil-muted: #9aa1ad;
  --surface: #f3f4f6;
  --surface-raised: #ffffff;
  --ink: #14161b;
  --ink-muted: #5a606b;
  --line: #d9dce1;
  --line-strong: #80868f;
  --danger: #b3261e;
  --success: #1f7a4d;

  --font-display: Archivo, "Arial Black", Helvetica, sans-serif;
  --font-sans: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-12: 48px; --space-16: 64px; --space-24: 96px;
  --chamfer: 10px;
  --wrap: 1200px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --molten-ink: #ff8a57; --molten-soft: #3a1c10; --quench: #7fb0de; --quench-soft: #14263a;
    --anvil: #1b1f25; --surface: #0e1013; --surface-raised: #171a1f; --ink: #eef0f3; --ink-muted: #9aa1ad;
    --line: #2a2e35; --line-strong: #6b727d; --danger: #ff8a80; --success: #5ccf94;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 400 16px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--quench); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(var(--space-6), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-6), env(safe-area-inset-right, 0px)); }
@media (max-width: 640px) { .wrap { padding-left: max(var(--space-4), env(safe-area-inset-left, 0px)); padding-right: max(var(--space-4), env(safe-area-inset-right, 0px)); } }

/* Mark & logo */
.gfs-mark { display: block; height: 1em; width: auto; }
.gfs-mark .iron { fill: currentColor; }
.gfs-mark .bar { fill: var(--molten); }
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo .gfs-mark { font-size: 34px; }
.logo-text { display: flex; flex-direction: column; gap: 4px; line-height: 1; }
.logo-name { font-family: var(--font-display); font-weight: 800; font-stretch: 118%; font-size: 17px; letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; }
.logo-sub { font-family: var(--font-mono); font-weight: 500; font-size: 10px; letter-spacing: .55em; text-transform: uppercase; color: var(--ink-muted); }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); height: 72px; }
.nav { display: flex; align-items: center; gap: var(--space-8); }
.nav a { text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink-muted); }
.nav a:hover { color: var(--ink); }
.nav .lang { color: var(--ink); padding: 6px 10px; box-shadow: inset 0 0 0 1px var(--line); }
.nav .lang:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-strong); width: 44px; height: 44px; color: var(--ink); cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 18px; height: 2px; background: currentColor; margin: 0 auto; position: relative; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; } .nav-toggle span::after { top: 6px; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: var(--space-2) max(var(--space-4), env(safe-area-inset-right, 0px)) var(--space-6) max(var(--space-4), env(safe-area-inset-left, 0px)); }
  .nav:not(.open) { display: none; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .nav .btn { margin-top: var(--space-4); justify-content: center; }
}

/* Buttons: chamfer painted on ::before so the focus ring is never clipped */
.btn { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: var(--space-2); font: 600 15px/20px var(--font-sans); padding: var(--space-3) var(--space-6); border: 0; background: none; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; transition: background .18s ease-out, box-shadow .18s ease-out; }
.btn-primary, .nav a.btn-primary { color: var(--on-molten); }
.btn-primary::before { background: var(--molten); clip-path: polygon(0 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, 0 100%); }
.btn-primary:hover::before { background: var(--ember); }
.btn-secondary::before { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn-secondary:hover::before { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-lg { font-size: 17px; padding: 16px var(--space-8); }

/* Type helpers */
.eyebrow { display: block; font-size: 16px; font-weight: 500; color: var(--ink-muted); }
.section { padding-block: var(--space-24); border-top: 1px solid var(--line); }
@media (max-width: 640px) { .section { padding-block: var(--space-16); } }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: var(--space-8) var(--space-16); align-items: end; margin-bottom: var(--space-12); }
.section-head h2 { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.08; font-weight: 800; letter-spacing: -.015em; }
.section-head p { color: var(--ink-muted); font-size: 17px; line-height: 1.6; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; } }

/* Hero */
.hero { padding-block: var(--space-16) var(--space-24); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-12); align-items: center; }
.hero h1 { font-size: clamp(44px, 7vw, 88px); line-height: .98; font-weight: 800; font-stretch: 112%; letter-spacing: -.03em; margin-top: var(--space-6); }
.hero-sub { margin-top: var(--space-6); max-width: 34em; font-size: 19px; line-height: 1.6; color: var(--ink-muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-8); }
.hero-platforms { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-12); }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding-block: var(--space-12) var(--space-16); } }

/* The forge panel: an anvil block with lines of glowing "code" bars */
.forge { position: relative; background: var(--anvil); color: var(--on-anvil); padding: var(--space-8); clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%); min-height: 420px; display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-8); overflow: hidden; }
.forge-top { display: flex; justify-content: space-between; align-items: center; font: 500 12px/16px var(--font-mono); color: var(--on-anvil-muted); }
.forge-top .dot { display: inline-flex; align-items: center; gap: 8px; }
.forge-top .dot::before { content: ""; width: 8px; height: 8px; background: var(--ember); animation: pulse 2.4s ease-in-out infinite; }
.forge-lines { display: grid; gap: 10px; }
.forge-line { display: flex; gap: 10px; align-items: center; }
.forge-line i { display: block; height: 12px; background: #2f3540; transform-origin: left; animation: forge-in .7s cubic-bezier(.2,.7,.2,1) both; }
.forge-line i.hot { background: var(--molten); }
.forge-line i.warm { background: var(--ember); }
.forge-line i.cool { background: #3c5f84; }
.forge-mark { font-size: 76px; color: var(--on-anvil); }
.forge-foot { display: flex; justify-content: space-between; align-items: end; gap: var(--space-4); }
.forge-foot p { font: 500 12px/18px var(--font-mono); color: var(--on-anvil-muted); text-align: right; }
@keyframes forge-in { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes pulse { 50% { opacity: .35; } }

/* Tags */
.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/18px var(--font-sans); padding: 3px var(--space-2); border-radius: 2px; color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface-raised); }
.tag-molten { background: var(--molten-soft); color: var(--molten-ink); box-shadow: none; }

/* Services */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.service { padding: var(--space-8) var(--space-6); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--space-4); background: var(--surface-raised); min-width: 0; transition: background .2s ease-out; }
.service-bar { width: 40px; height: 12px; background: var(--ink); transition: width .25s ease-out, background .25s ease-out; }
.service:hover .service-bar { width: 72px; background: var(--molten); }
.service h3 { font-size: 22px; line-height: 28px; font-weight: 700; }
.service p { color: var(--ink-muted); font-size: 15px; line-height: 1.6; }
.service ul { list-style: none; margin: auto 0 0; padding: var(--space-4) 0 0; display: grid; gap: 6px; border-top: 1px solid var(--line); }
.service li { font-size: 14px; line-height: 20px; color: var(--ink); display: flex; gap: 10px; align-items: baseline; }
.service li::before { content: ""; flex: none; width: 8px; height: 3px; background: var(--molten); transform: translateY(-3px); }

/* Work */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-6); }
@media (max-width: 400px) { .work-grid { grid-template-columns: 1fr; } }
.work-card { display: flex; flex-direction: column; background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; color: inherit; min-width: 0; transition: box-shadow .2s ease-out, transform .2s ease-out; }
.work-card:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.work-card.featured { grid-column: span 2; }
@media (max-width: 760px) { .work-card.featured { grid-column: auto; } }
.work-media { aspect-ratio: 16 / 10; background: var(--anvil); overflow: hidden; position: relative; max-width: 100%; }
.work-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease-out; }
.work-media .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--on-anvil); font-size: 72px; }
.work-body { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.work-body .industry { font-size: 14px; font-weight: 600; color: var(--molten-ink); }
.work-body h3 { font-size: 24px; line-height: 30px; font-weight: 700; }
.work-body p { color: var(--ink-muted); font-size: 15px; line-height: 1.6; }
.work-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; padding-top: var(--space-2); }
.work-empty { padding: var(--space-12); text-align: center; color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--line); }

/* Process */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6); counter-reset: step; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-6); border-top: 3px solid var(--ink); counter-increment: step; }
.step::before { content: "0" counter(step); font: 500 13px/1 var(--font-mono); color: var(--ink-muted); }
.step h3 { font-size: 22px; line-height: 28px; font-weight: 700; }
.step p { color: var(--ink-muted); font-size: 15px; line-height: 1.6; }

/* About band */
.band { background: var(--anvil); color: var(--on-anvil); border-top: 0; }
.band .eyebrow { color: var(--on-anvil-muted); }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-16); align-items: start; }
.about-grid h2 { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.08; font-weight: 800; letter-spacing: -.015em; }
.about-grid > div > p { margin-top: var(--space-6); font-size: 17px; line-height: 1.7; color: var(--on-anvil-muted); max-width: 36em; }
.stats { display: grid; gap: 0; }
.stat { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--space-6); align-items: baseline; padding-block: var(--space-6); border-bottom: 1px solid #2f3540; }
.stat:first-child { border-top: 1px solid #2f3540; }
.stat b { font: 800 48px/1 var(--font-display); color: var(--on-anvil); font-variant-numeric: tabular-nums; }
.stat:first-child b { color: var(--molten); }
.stat span { color: var(--on-anvil-muted); font-size: 15px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: var(--space-8); } .stat { grid-template-columns: 100px minmax(0, 1fr); } .stat b { font-size: 40px; } }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--space-16); align-items: start; }
@media (max-width: 960px) { .contact-grid { grid-template-columns: 1fr; gap: var(--space-8); } }
.contact-grid h2 { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.08; font-weight: 800; letter-spacing: -.015em; }
.contact-intro > p { margin-top: var(--space-6); color: var(--ink-muted); font-size: 17px; line-height: 1.6; }
.contact-list { list-style: none; padding: 0; margin: var(--space-8) 0 0; display: grid; border-top: 1px solid var(--line); }
.contact-list li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: var(--space-4); padding-block: var(--space-4); border-bottom: 1px solid var(--line); align-items: baseline; }
.contact-list span { font-size: 14px; color: var(--ink-muted); }
.contact-list a, .contact-list b { font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--molten-ink); }

.form { background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line); padding: var(--space-8); display: grid; gap: var(--space-6); }
@media (max-width: 560px) { .form { padding: var(--space-6) var(--space-4); } }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: var(--space-2); min-width: 0; }
.field label, .field legend { font-size: 14px; font-weight: 600; padding: 0; }
.field .opt { font-weight: 400; color: var(--ink-muted); }
.field input, .field select, .field textarea { width: 100%; font: 400 16px/24px var(--font-sans); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 2px; padding: 10px 12px; }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--quench); outline-offset: 1px; border-color: var(--ink); }
.field .error { color: var(--danger); font-size: 13px; }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
fieldset.field { border: 0; margin: 0; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { position: relative; }
.field .chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; padding: 8px 14px; font-size: 14px; border: 1.5px solid var(--line-strong); cursor: pointer; user-select: none; transition: background .15s, border-color .15s; }
.chip input:checked + span { background: var(--molten-soft); border-color: var(--molten); color: var(--molten-ink); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--quench); outline-offset: 2px; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-4); }
.form-foot small { color: var(--ink-muted); font-size: 13px; }
.notice { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); background: var(--molten-soft); color: var(--ink); font-weight: 500; }
.notice::before { content: ""; flex: none; width: 12px; height: 12px; margin-top: 5px; background: var(--molten); }

/* Project page */
.project-hero { padding-block: var(--space-12) var(--space-12); }
.back { display: inline-flex; gap: 8px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--ink-muted); }
.back:hover { color: var(--ink); }
.project-hero h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1; font-weight: 800; letter-spacing: -.02em; margin-top: var(--space-6); }
.project-hero .lead { margin-top: var(--space-6); max-width: 40em; font-size: 19px; line-height: 1.6; color: var(--ink-muted); }
.project-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-6); }
.project-links { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.project-cover { aspect-ratio: 16 / 9; background: var(--anvil); max-width: 100%; overflow: hidden; }
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--space-16); padding-block: var(--space-16); }
@media (max-width: 860px) { .project-body { grid-template-columns: 1fr; gap: var(--space-8); } }
.prose { font-size: 17px; line-height: 1.75; max-width: 42em; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 28px; line-height: 1.2; margin-top: 1.6em; }
.prose h3 { font-size: 22px; margin-top: 1.4em; }
.prose a { color: var(--molten-ink); }
.facts { display: grid; align-content: start; border-top: 3px solid var(--ink); }
.facts div { padding-block: var(--space-4); border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.facts dt { font-size: 14px; color: var(--ink-muted); }
.facts dd { margin: 0; font-weight: 500; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); padding-bottom: var(--space-16); }
.gallery a { display: block; background: var(--anvil); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.gallery img { width: 100%; height: 100%; aspect-ratio: 9 / 16; object-fit: cover; transition: transform .3s ease-out; }
.gallery a:hover img { transform: scale(1.03); }

/* CTA strip */
.cta { background: var(--molten); color: var(--on-molten); padding-block: var(--space-16); }
.cta .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-6); }
.cta h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; font-weight: 800; max-width: 18em; }
.cta .btn-dark { color: var(--on-anvil); }
.cta .btn-dark::before { background: #14161b; clip-path: polygon(0 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, 0 100%); }
.cta .btn-dark:hover::before { background: #2b313b; }

/* Footer */
.site-footer { background: var(--anvil); color: var(--on-anvil); padding-block: var(--space-16) var(--space-8); }
.site-footer .logo { color: var(--on-anvil); }
.site-footer .logo-sub { color: var(--on-anvil-muted); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: var(--space-12); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; gap: var(--space-8); } }
.foot-grid p { margin-top: var(--space-4); color: var(--on-anvil-muted); max-width: 28em; }
.foot-grid h4 { margin: 0 0 var(--space-4); font-size: 14px; font-weight: 500; color: var(--on-anvil-muted); }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.foot-grid a { text-decoration: none; color: var(--on-anvil); overflow-wrap: anywhere; }
.foot-grid a:hover { color: #ff8a57; }
.foot-bottom { margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid #2f3540; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); font-size: 14px; color: var(--on-anvil-muted); }

/* WhatsApp */
.wa { position: fixed; inset-inline-end: max(var(--space-4), env(safe-area-inset-right, 0px)); bottom: max(var(--space-4), env(safe-area-inset-bottom, 0px)); z-index: 25; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; background: #14161b; color: #eef0f3; text-decoration: none; font-weight: 600; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.wa svg { width: 20px; height: 20px; fill: #25d366; }


/* Motion: the mark's story, spark -> forge -> launch. One load sequence,
   one ambient band, and responses to what people do. */
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rod-out { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes iron-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes spark-pop { 0% { transform: scale(0) rotate(-90deg); opacity: 0; } 60% { transform: scale(1.5) rotate(10deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes spark-twinkle { 0%, 88%, 100% { transform: scale(1) rotate(0); } 92% { transform: scale(1.45) rotate(45deg); } 96% { transform: scale(.85) rotate(90deg); } }
@keyframes band { to { transform: translateX(-50%); } }
@keyframes band-rtl { to { transform: translateX(50%); } }

.hero-copy > * { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.hero-copy > :nth-child(1) { animation-delay: .05s; }
.hero-copy > :nth-child(2) { animation-delay: .12s; }
.hero-copy > :nth-child(3) { animation-delay: .22s; }
.hero-copy > :nth-child(4) { animation-delay: .32s; }
.hero-copy > :nth-child(5) { animation-delay: .42s; }

.forge-mark .iron, .forge-mark .rod, .forge-mark .spark { transform-box: fill-box; }
.forge-mark .iron { transform-origin: center; animation: iron-in .5s ease-out .9s both; }
.forge-mark .rod { transform-origin: left center; animation: rod-out .7s cubic-bezier(.7,0,.2,1) 1.25s both; }
.forge-mark .spark { transform-origin: center; animation: spark-pop .5s ease-out 1.85s both, spark-twinkle 7s ease-in-out 3s infinite; }

/* A bar "heats" for a moment, as if that line of the build is being worked */
.forge-line i { transition: background-color 1.2s ease-out, box-shadow 1.2s ease-out; }
.forge-line i.heat { background: var(--molten); box-shadow: 0 0 14px rgba(255, 95, 31, .55); transition-duration: .25s; }
.forge-line i.heat.warm, .forge-line i.heat.cool { background: var(--ember); box-shadow: 0 0 14px rgba(255, 176, 32, .5); }

/* Logo and buttons answer the pointer */
.logo .spark { transform-box: fill-box; transform-origin: center; transition: transform .45s cubic-bezier(.3,1.6,.5,1); }
.logo:hover .spark { transform: rotate(90deg) scale(1.3); }
.btn-primary::after { content: ""; position: absolute; top: -7px; right: -7px; width: 14px; height: 14px; background: var(--ember); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); transform: scale(0) rotate(-90deg); transition: transform .35s cubic-bezier(.3,1.6,.5,1); pointer-events: none; }
.btn-primary:hover::after, .btn-primary:focus-visible::after { transform: scale(1) rotate(0); }
[dir="rtl"] .btn-primary::after { right: auto; left: -7px; }

/* The molten band: the bar from the mark, carrying what we stand for */
.molten-band { background: var(--molten); color: var(--on-molten); overflow: hidden; border-block: 1px solid #14161b; }
.molten-track { display: flex; width: max-content; animation: band 48s linear infinite; }
[dir="rtl"] .molten-track { animation-name: band-rtl; }
.molten-band:hover .molten-track { animation-play-state: paused; }
.molten-set { display: flex; align-items: center; gap: var(--space-8); padding-inline-end: var(--space-8); }
.molten-phrase { font: 800 22px/1 var(--font-display); font-stretch: 112%; letter-spacing: -.01em; white-space: nowrap; padding-block: 20px; }
[dir="rtl"] .molten-phrase { font-stretch: normal; letter-spacing: 0; font-weight: 700; line-height: 1.3; padding-block: 16px; }
.molten-spark { width: 14px; height: 14px; flex: none; fill: #14161b; }
@media (max-width: 640px) { .molten-phrase { font-size: 18px; padding-block: 14px; } }

/* Process: a molten line fills the four steps as you scroll through them */
.steps { position: relative; }
.steps::after { content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 100%; height: 3px; background: var(--molten); transform: scaleX(var(--progress, 1)); transform-origin: left center; }
[dir="rtl"] .steps::after { transform-origin: right center; }
.steps .step { transition: border-color .3s; }
@media (max-width: 560px) {
  .steps { padding-inline-start: var(--space-6); }
  .steps .step { border-top: 0; padding-top: 0; }
  .steps::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 3px; background: var(--ink); }
  .steps::after { width: 3px; height: 100%; transform: scaleY(var(--progress, 1)); transform-origin: center top; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .molten-track { flex-wrap: wrap; width: auto; }
  .molten-set + .molten-set { display: none; }
  html { scroll-behavior: auto; }
}

/* Arabic: right-to-left, Plex Sans Arabic for display and text, chamfer mirrored */
[dir="rtl"] {
  --font-display: "IBM Plex Sans Arabic", Archivo, Tahoma, sans-serif;
  --font-sans: "IBM Plex Sans Arabic", "IBM Plex Sans", Tahoma, sans-serif;
}
[dir="rtl"] body { line-height: 1.7; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; font-stretch: normal; font-weight: 700; }
[dir="rtl"] .hero h1 { line-height: 1.2; font-stretch: normal; letter-spacing: 0; }
[dir="rtl"] .project-hero h1 { line-height: 1.2; }
[dir="rtl"] .section-head h2, [dir="rtl"] .about-grid h2, [dir="rtl"] .contact-grid h2 { line-height: 1.3; }
[dir="rtl"] .btn-primary::before, [dir="rtl"] .cta .btn-dark::before { clip-path: polygon(var(--chamfer) 0, 100% 0, 100% 100%, 0 100%, 0 var(--chamfer)); }
[dir="rtl"] .back-arrow { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .stat b { font-family: Archivo, sans-serif; }
[dir="rtl"] .field input[dir="ltr"] { text-align: right; }

/* Legal pages and footer links */
.legal { padding-block: var(--space-12) var(--space-24); }
.legal-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: var(--space-16); align-items: start; }
.legal-head { position: sticky; top: calc(96px + env(safe-area-inset-top, 0px)); display: grid; gap: var(--space-4); }
.legal-head h1 { font-size: clamp(32px, 4vw, 44px); line-height: 1.1; font-weight: 800; }
.legal-head .muted { color: var(--ink-muted); font-size: 14px; }
.legal-nav { display: grid; border-top: 3px solid var(--ink); }
.legal-nav a { padding-block: 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink-muted); font-weight: 500; }
.legal-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 3px 0 0 var(--molten); padding-inline-start: 12px; }
[dir="rtl"] .legal-nav a[aria-current="page"] { box-shadow: inset -3px 0 0 var(--molten); }
.legal-body ul { padding-inline-start: 1.2em; }
.legal-body li + li { margin-top: .4em; }
@media (max-width: 860px) { .legal-grid { grid-template-columns: 1fr; gap: var(--space-8); } .legal-head { position: static; } }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.foot-links a { color: var(--on-anvil-muted); text-decoration: none; }
.foot-links a:hover { color: var(--on-anvil); }

/* 404: the mark without its spark, the bar gone cold */
.not-found { padding-block: var(--space-16) var(--space-24); }
.not-found-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-16); align-items: center; }
.not-found h1 { font-size: clamp(36px, 5vw, 60px); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
[dir="rtl"] .not-found h1 { line-height: 1.3; letter-spacing: 0; }
.cold { display: grid; gap: var(--space-6); justify-items: start; }
.cold svg { width: min(100%, 280px); }
.cold .iron { fill: var(--ink); }
.cold .rod { fill: var(--line-strong); transform-box: fill-box; transform-origin: left center; animation: cool 2.4s ease-out both; }
.cold .code { font: 500 15px var(--font-mono); color: var(--ink-muted); letter-spacing: .3em; }
@keyframes cool { from { fill: var(--molten); } to { fill: var(--line-strong); } }
@media (max-width: 760px) { .not-found-grid { grid-template-columns: 1fr; gap: var(--space-8); } .cold svg { width: 160px; } }
