/* ==========================================================================
   Tekinsight — site styles
   ========================================================================== */

/* Self-hosted fonts (no requests to Google Fonts) */
/* Bricolage Grotesque — latin-ext */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/bricolage-grotesque-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Bricolage Grotesque — latin */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(../fonts/bricolage-grotesque-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Inter — latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Inter — latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Inter — latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Inter — latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Inter — latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Inter — latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #eeece6;
  --ink: #0d1321;
  --ink-soft: #3a4252;
  --muted: #5d6474;
  --line: #e1ded6;
  --accent: #2f5bff;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecff;

  --dark-bg: #0b1120;
  --dark-surface: #131b2e;
  --dark-line: #222c44;
  --dark-ink: #f3f5fa;
  --dark-muted: #9aa4ba;
  --dark-accent: #6f8cff;

  --flutter: #0468d7;
  --rails: #cc342d;
  --sagax-a: #38bdf8;
  --sagax-b: #8b5cf6;

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 18px;
  --radius-sm: 10px;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --shadow: 0 1px 2px rgba(13, 19, 33, .04), 0 8px 24px rgba(13, 19, 33, .06);
  --phone-frame: #0a0e18;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1424;
    --surface: #151d31;
    --surface-2: #1a2339;
    --ink: #eef1f7;
    --ink-soft: #c9cfdc;
    --muted: #98a2b8;
    --line: #243051;
    --accent: #6f8cff;
    --accent-ink: #0b1120;
    --accent-soft: #1d2a52;
    --dark-bg: #080d19;
    --dark-surface: #111a2e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

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

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
}
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons & small parts ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .85em 1.4em;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 1rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn:active { transform: none; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); box-shadow: none; }

.btn-small { padding: .6em 1.05em; font-size: .9375rem; }

.eyebrow {
  font: 600 .8125rem/1.2 var(--font-body);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.chip {
  display: inline-block;
  padding: .3em .75em;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-soft);
}
.chip-flutter { background: color-mix(in srgb, var(--flutter) 12%, transparent); color: var(--flutter); }
.chip-rails { background: color-mix(in srgb, var(--rails) 11%, transparent); color: var(--rails); }

@media (prefers-color-scheme: dark) {
  .chip-flutter { color: #5aa9ff; }
  .chip-rails { color: #ff6b63; }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { width: 30px; height: 30px; }
.brand-name {
  font: 700 1.25rem/1 var(--font-display);
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: .9375rem;
  font-weight: 500;
}
.site-nav a:not(.btn) {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 6px 0;
  position: relative;
}
.site-nav a:not(.btn):hover,
.site-nav a.is-active { color: var(--ink); }
.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.site-nav a.lang-switch {
  padding: 3px 9px;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .04em;
  border: 1.5px solid var(--line);
  border-radius: 999px;
}
.site-nav a.lang-switch:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.lang-long { display: none; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  margin-right: -10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 22px; height: 2px;
  margin-inline: auto;
  background: currentColor;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before,
.nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    font-size: 1.125rem;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  }
  .site-nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: opacity .2s ease, transform .2s ease;
  }
  .site-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-nav a.is-active::after { display: none; }
  .site-nav a.lang-switch {
    padding: 14px 0;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: normal;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .lang-short { display: none; }
  .lang-long { display: inline; }
  .site-nav .btn { margin-top: 18px; justify-content: center; padding: .9em 1.2em; font-size: 1rem; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(40px, 7vw, 96px) 0 clamp(16px, 3vw, 40px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 11%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 70% at 75% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 75% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.hero h1 {
  font-size: clamp(2.6rem, 6.2vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 12ch;
}

.lede {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  color: var(--ink-soft);
}
.lede strong { color: var(--ink); font-weight: 600; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2rem;
}

.hero-proof {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 2.5rem;
  font-size: .9375rem;
  color: var(--muted);
}
.hero-proof strong { color: var(--ink-soft); font-weight: 600; }

.icon-stack { display: flex; flex-shrink: 0; }
.icon-stack li + li { margin-left: -10px; }
.icon-stack img {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 2px solid var(--bg);
  background: #fff;
  object-fit: cover;
}

.hero-visual {
  position: relative;
  height: clamp(420px, 46vw, 580px);
}
.hero-visual .phone {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(170px, 18vw, 232px);
}
.hero-visual .phone-center {
  z-index: 3;
  transform: translate(-50%, -50%);
}
.hero-visual .phone-left {
  z-index: 1;
  transform: translate(-112%, -46%) rotate(-8deg);
}
.hero-visual .phone-right {
  z-index: 2;
  transform: translate(12%, -46%) rotate(8deg);
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { height: clamp(360px, 92vw, 480px); }
  .hero-visual .phone { width: clamp(140px, 36vw, 200px); }
}

/* ---------- Phone frame ---------- */

.phone {
  aspect-ratio: 598 / 1300;
  padding: 6px;
  background: var(--phone-frame);
  border-radius: clamp(22px, 2.6vw, 34px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .06) inset,
    0 30px 60px -20px rgba(13, 19, 33, .45),
    0 12px 24px -12px rgba(13, 19, 33, .3);
}
.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: calc(clamp(22px, 2.6vw, 34px) - 6px);
}

/* ---------- Sections ---------- */

.section { padding: clamp(72px, 10vw, 128px) 0; }

.section-head { max-width: 40rem; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head h2 {
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 750;
}
.section-intro {
  margin-top: 1rem;
  font-size: 1.125rem;
  color: var(--muted);
}

.section-tint { background: var(--surface-2); }

/* ---------- Services ---------- */

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.service-card {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 34px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.service-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}
.service-num {
  font: 600 .875rem/1 var(--font-body);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.service-card h3 { font-size: 1.625rem; margin-bottom: .75rem; }
.service-card > p { color: var(--muted); }

.ticks {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: .6rem;
  font-size: .9375rem;
  color: var(--ink-soft);
}
.ticks li {
  position: relative;
  padding-left: 1.6rem;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0; top: .42em;
  width: .9rem; height: .5rem;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg) scale(.8);
  transform-origin: center;
}

.fullstack {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 32px;
  padding: clamp(24px, 3vw, 40px);
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
}
.fullstack h3 { font-size: clamp(1.5rem, 2.4vw, 1.875rem); margin-bottom: .75rem; }
.fullstack p { color: color-mix(in srgb, var(--bg) 72%, transparent); }

.fullstack-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  counter-reset: flow;
}
.fullstack-flow li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--bg) 18%, transparent);
  border-radius: var(--radius-sm);
}
.fullstack-flow li span { font-weight: 600; }
.fullstack-flow li small { color: color-mix(in srgb, var(--bg) 60%, transparent); font-size: .8125rem; }
.fullstack-flow li + li::before {
  content: "";
  position: absolute;
  left: -12px; top: 50%;
  width: 12px; height: 1.5px;
  background: color-mix(in srgb, var(--bg) 35%, transparent);
}

@media (max-width: 980px) {
  .service-grid { grid-template-columns: 1fr; }
  .fullstack { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .fullstack-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fullstack-flow li:nth-child(3)::before { display: none; }
}

/* ---------- Work (dark section) ---------- */

.section-dark {
  background: var(--dark-bg);
  color: var(--dark-ink);
  --line: var(--dark-line);
  --muted: var(--dark-muted);
  --accent: var(--dark-accent);
}
.section-dark .eyebrow { color: var(--dark-accent); }

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  padding: clamp(24px, 4vw, 56px);
  background: var(--dark-surface);
  border: 1px solid var(--dark-line);
  border-radius: calc(var(--radius) + 6px);
}
.project + .project { margin-top: 24px; }

.project-id {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 1.25rem;
}
.app-icon {
  width: 64px; height: 64px;
  border-radius: 15px;
  background: #fff;
  object-fit: cover;
  flex-shrink: 0;
}
.app-icon-sm { width: 44px; height: 44px; border-radius: 11px; }

.project-kicker {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dark-muted);
  margin-bottom: .35rem;
}
.project h3 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.project h4 { font-size: 1.5rem; }
.project-lead {
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.project-body > p:not(.project-lead) { color: var(--dark-muted); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.5rem;
}
.tags li {
  padding: .3em .75em;
  border: 1px solid var(--dark-line);
  border-radius: 999px;
  font-size: .8125rem;
  color: var(--dark-muted);
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 1.5rem;
}
.store-links a {
  font-weight: 600;
  font-size: .9375rem;
  color: var(--dark-ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--dark-accent);
  padding-bottom: 2px;
}
.store-links a:hover { color: var(--dark-accent); }

.project-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
  max-width: 460px;
  justify-self: center;
  width: 100%;
}
.project-shots .phone:nth-child(2) { transform: translateY(32px); }

.arch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  margin-top: 1.75rem;
}
.arch-node {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--dark-line);
  border-radius: var(--radius-sm);
  background: var(--dark-bg);
}
.arch-node strong { font-size: .9375rem; }
.arch-node span { font-size: .8125rem; color: var(--dark-muted); }
.arch-node-accent { border-color: color-mix(in srgb, var(--dark-accent) 55%, transparent); }
.arch-link {
  position: relative;
  width: clamp(56px, 7vw, 88px);
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--dark-accent) 0 6px, transparent 6px 11px);
}
.arch-link::after {
  content: "";
  position: absolute;
  right: -1px; top: 50%;
  width: 8px; height: 8px;
  border-top: 2px solid var(--dark-accent);
  border-right: 2px solid var(--dark-accent);
  transform: translateY(-50%) rotate(45deg);
}
.arch-link span {
  position: absolute;
  left: 50%; bottom: 8px;
  transform: translateX(-50%);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--dark-accent);
}

/* Sagax */
.project-sagax {
  display: block;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 10% 0%, color-mix(in srgb, var(--sagax-b) 22%, transparent), transparent 70%),
    radial-gradient(ellipse 50% 50% at 100% 100%, color-mix(in srgb, var(--sagax-a) 16%, transparent), transparent 70%),
    var(--dark-surface);
}
.sagax-head {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  max-width: 820px;
  margin-bottom: clamp(32px, 4vw, 48px);
}
.sagax-logo {
  width: 220px;
  border-radius: var(--radius);
}
.sagax-head h3 {
  background: linear-gradient(90deg, var(--sagax-a), var(--sagax-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: .75rem;
  width: fit-content;
}
.sagax-head .project-lead { margin: 0; color: var(--dark-ink); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.game {
  padding: clamp(20px, 3vw, 32px);
  background: color-mix(in srgb, var(--dark-bg) 70%, transparent);
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
}
.game > p { color: var(--dark-muted); }
.game-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 320px;
  margin: 0 auto 28px;
}
.game .project-id { margin-bottom: .75rem; }

/* Guia TV */
.project-tv .project-shots { order: 0; }

@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; }
  .project-tv .project-shots { order: 1; }
  .project-shots { max-width: 360px; margin-bottom: 32px; }
  .game-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sagax-head { grid-template-columns: 1fr; }
  .sagax-logo { width: 180px; }
  .arch { grid-template-columns: 1fr; justify-items: stretch; gap: 0; }
  .arch-link {
    width: 2px; height: 40px;
    justify-self: center;
    background: repeating-linear-gradient(180deg, var(--dark-accent) 0 6px, transparent 6px 11px);
  }
  .arch-link::after {
    right: auto; left: 50%; top: auto; bottom: -1px;
    transform: translateX(-50%) rotate(135deg);
  }
  .arch-link span { left: 14px; bottom: 50%; transform: translateY(50%); }
}

/* ---------- Process ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  counter-reset: step;
}
.step {
  position: relative;
  padding-top: 28px;
  border-top: 2px solid var(--line);
}
.step::before {
  content: "";
  position: absolute;
  top: -2px; left: 0;
  width: 40px; height: 2px;
  background: var(--accent);
}
.step-num {
  display: block;
  font: 750 2.5rem/1 var(--font-display);
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.step h3 { font-size: 1.375rem; margin-bottom: .5rem; }
.step p { color: var(--muted); font-size: .9688rem; }

@media (max-width: 980px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 24px; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.about-grid h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); margin-bottom: 1.5rem; }
.about-lead {
  font-size: 1.25rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}
.about-grid > div > p:not(.about-lead):not(.eyebrow) { color: var(--muted); }

.values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.values li {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.values h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.values p { color: var(--muted); font-size: .9688rem; }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .values { grid-template-columns: 1fr; }
}

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.contact-copy h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); margin-bottom: 1.25rem; }
.contact-copy > p:not(.eyebrow) { color: var(--muted); font-size: 1.125rem; }

.contact-points {
  margin-top: 2rem;
  display: grid;
  gap: .75rem;
}
.contact-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
}
.contact-points li::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.contact-form {
  display: grid;
  gap: 20px;
  padding: clamp(24px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.field { display: grid; gap: 8px; min-width: 0; }
fieldset.field { border: 0; margin: 0; padding: 0; }
.field label,
.field legend {
  font-size: .9375rem;
  font-weight: 600;
  padding: 0;
}
fieldset.field legend { margin-bottom: 8px; }
.optional { font-weight: 400; color: var(--muted); }

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, background-color .15s ease;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:hover,
.field textarea:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field [aria-invalid="true"] { border-color: #d93a3a; }

.choice-group { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.choice span {
  display: inline-block;
  padding: .55em 1em;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: all .15s ease;
}
.choice:hover span { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.choice input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.cf-turnstile { min-height: 65px; } /* reserve the widget's height so the form doesn't jump */

.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.form-status { font-size: .9375rem; color: var(--muted); }
.form-status.is-success { color: #16803c; font-weight: 500; }
.form-status.is-error { color: #c62f2f; font-weight: 500; }
@media (prefers-color-scheme: dark) {
  .form-status.is-success { color: #4ade80; }
  .form-status.is-error { color: #f87171; }
}

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; }
  .form-footer .btn { width: 100%; justify-content: center; }
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 56px 0 32px;
  background: var(--dark-bg);
  color: var(--dark-muted);
  font-size: .9375rem;
}
.site-footer .brand { color: var(--dark-ink); }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}
.footer-brand p { margin-top: 14px; line-height: 1.6; }
.footer-nav,
.footer-links { display: grid; gap: 10px; align-content: start; }
.site-footer a:not(.brand) { text-decoration: none; color: var(--dark-muted); }
.site-footer a:not(.brand):hover { color: var(--dark-ink); }
.footer-legal { margin-top: 48px; font-size: .875rem; }
.footer-legal-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--dark-line);
}

@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Reveal on scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .site-nav { transition: none; }
}

/* ---------- Cookie consent ---------- */

.consent {
  position: fixed;
  left: var(--gutter);
  bottom: var(--gutter);
  z-index: 60;
  width: min(440px, calc(100% - 2 * var(--gutter)));
  padding: 22px 24px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px -12px rgba(13, 19, 33, .35);
  font-size: .9375rem;
  line-height: 1.55;
}
.consent[hidden] { display: none; }
.consent-title {
  font: 700 1.125rem/1.2 var(--font-display);
  margin-bottom: .5rem;
}
.consent p:not(.consent-title) { color: var(--muted); }
.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.consent-actions .btn { justify-content: center; padding: .75em 1em; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--dark-muted);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover { color: var(--dark-ink); }

@media (prefers-reduced-motion: no-preference) {
  .consent:not([hidden]) { animation: consent-in .35s ease both; }
  @keyframes consent-in { from { opacity: 0; transform: translateY(12px); } }
}

.footer-legal-links { display: flex; gap: 20px; align-items: center; }
.consent a { color: var(--ink); text-underline-offset: 3px; }
.form-note { font-size: .875rem; color: var(--muted); }
.form-note a { color: inherit; text-underline-offset: 3px; }

/* ---------- Legal pages ---------- */

.legal { padding-top: clamp(40px, 6vw, 80px); }
.legal-inner { max-width: calc(46rem + 2 * var(--gutter)); }
.legal h1 {
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.legal-updated { margin-top: .75rem; font-size: .9375rem; color: var(--muted); }
.legal-lead { margin-top: 2rem; font-size: 1.1875rem; line-height: 1.55; }
.legal h2 {
  font-size: 1.625rem;
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.legal h3 { font-size: 1.1875rem; margin: 1.75rem 0 .5rem; }
.legal p, .legal ul { color: var(--ink-soft); }
.legal p + p, .legal p + ul, .legal ul + p { margin-top: .9rem; }
.legal ul { list-style: disc; padding-left: 1.25rem; }
.legal ul li + li { margin-top: .4rem; }
.legal a { color: var(--accent); text-underline-offset: 3px; }
.legal code { font-size: .875em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }

.legal-toc {
  margin-top: 2rem;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.legal-toc ol { list-style: decimal; padding-left: 1.25rem; display: grid; gap: .3rem; }
.legal-toc a { color: var(--ink-soft); text-decoration: none; }
.legal-toc a:hover { color: var(--accent); text-decoration: underline; }

.table-wrap { margin-top: 1rem; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.legal table { width: 100%; border-collapse: collapse; font-size: .9375rem; min-width: 560px; }
.legal th, .legal td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.legal th { background: var(--surface-2); font-weight: 600; color: var(--ink); }
.legal tr:last-child td { border-bottom: 0; }

.link-button-inline { color: var(--accent); }
.link-button-inline:hover { color: var(--ink); }
