/* 99SubS Net — Web Release Ver.3.0
   Layout: one dark page, 1200px column, sections split by hairlines,
   mono labels for the "technical" voice, one mint accent. */

:root {
  --bg: #0B0D10;          /* page ground */
  --surface: #0F1216;     /* panels, placeholders */
  --line: #1C2026;        /* hairlines */
  --line-strong: #2A2F37; /* outlines, buttons */
  --fg: #E8EAED;          /* main text */
  --muted: #A3A9B3;       /* body copy */
  --dim: #8A9099;         /* small labels */
  --faint: #5C636E;       /* decorative dots only */
  --accent: #3DF5B0;      /* single accent */
  --on-accent: #0B0D10;
  --tile: #E4E8EC;        /* client-logo tiles */
  --header-bg: rgba(11, 13, 16, 0.88);

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: 24px;
  --max: 1200px;
  --header-h: 68px;

  color-scheme: dark;
}

/* Light mode: same layout, light ground, darker mint so text stays readable */
:root[data-theme="light"] {
  --bg: #F5F6F4;
  --surface: #FFFFFF;
  --line: #E1E4E7;
  --line-strong: #C9CED4;
  --fg: #0E1114;
  --muted: #474E57;
  --dim: #5B626C;
  --faint: #A9AEB5;
  --accent: #087A50;
  --on-accent: #FFFFFF;
  --tile: #FFFFFF;
  --header-bg: rgba(245, 246, 244, 0.9);
  color-scheme: light;
}
:root[data-theme="light"] .client { border: 1px solid var(--line); }
/* The logo file is white on transparent: show it dark on the light ground */
:root[data-theme="light"] .brand-logo { filter: brightness(0); opacity: .9; }

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: 60;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 500; letter-spacing: -0.02em; }
p { margin: 0; }

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

.accent { color: var(--accent); }

.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: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 10px 16px; font-weight: 600;
}
.skip-link:focus { top: calc(16px + env(safe-area-inset-top, 0px)); color: var(--on-accent); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.stack { display: flex; flex-direction: column; gap: 48px; }
.stack-sm { display: flex; flex-direction: column; gap: 16px; }

.label, .kicker, .num {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.label { color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-bar {
  min-height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand:hover { color: var(--fg); }
.brand-logo { width: 36px; height: 36px; object-fit: contain; }
.brand-name { font-weight: 600; font-size: 18px; letter-spacing: 0.01em; }

.site-nav {
  display: flex; align-items: center; gap: 28px;
  font-family: var(--font-mono); font-size: 13px;
}
.site-nav a:not(.btn) { color: var(--muted); padding: 12px 0; }
.site-nav a:not(.btn):hover { color: var(--accent); }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  background: transparent; color: var(--fg);
  border: 1px solid var(--line-strong);
  align-items: center; justify-content: center; cursor: pointer;
}
.menu-toggle .icon-close { display: none; }
.site-header.is-open .menu-toggle .icon-open { display: none; }
.site-header.is-open .menu-toggle .icon-close { display: block; }

/* Language switch (ID / EN) */
.lang-switch { display: flex; border: 1px solid var(--line-strong); flex: none; }
.lang-btn {
  display: flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0 11px;
  background: transparent; color: var(--dim);
  border: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
  transition: background-color .2s, color .2s;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--line-strong); }
.lang-btn .flag { display: block; flex: none; outline: 1px solid var(--line-strong); opacity: .55; transition: opacity .2s; }
.lang-btn:hover { color: var(--fg); }
.lang-btn:hover .flag { opacity: 1; }
.lang-btn[aria-pressed="true"] { background: var(--surface); color: var(--accent); }
.lang-btn[aria-pressed="true"] .flag { opacity: 1; }

/* Theme switch (dark / light) */
.theme-toggle {
  width: 42px; height: 42px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line-strong); cursor: pointer;
  transition: color .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  font-family: var(--font-display); font-size: 15px; font-weight: 500;
  border: 1px solid transparent;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn-solid { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-solid:hover { background: var(--fg); color: var(--on-accent); }
.btn-outline { border-color: var(--accent); color: var(--accent); min-height: 44px; padding: 0 18px; font-family: var(--font-mono); font-size: 13px; }
.btn-outline:hover { background: var(--accent); color: var(--on-accent); }
.btn-outline-muted { border-color: var(--line-strong); color: var(--fg); }
.btn-outline-muted:hover { border-color: var(--accent); color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Hero ---------- */
.hero {
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
}
.hero-grid {
  padding-block: 112px 104px;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 56px;
}
.hero-copy { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.kicker { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none;
  animation: pulse 2.4s ease-in-out infinite;
}
.hero h1 {
  font-size: clamp(42px, 7vw, 88px);
  line-height: 1.0; font-weight: 600; letter-spacing: -0.035em;
}
.lead { max-width: 34em; font-size: 19px; color: var(--muted); }

.terminal {
  /* the terminal panel stays dark in both modes */
  --surface: #0F1216; --line: #1C2026; --line-strong: #2A2F37;
  --fg: #E8EAED; --muted: #A3A9B3; --faint: #5C636E; --accent: #3DF5B0;
  flex: 1 1 320px; min-width: 0;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-family: var(--font-mono); font-size: 13px; line-height: 2;
}
.terminal-bar { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.terminal-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.terminal-body { padding: 18px 20px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.terminal-body b { color: var(--accent); font-weight: 400; }
.terminal-body .dots { color: var(--faint); }
.cursor {
  display: inline-block; width: 8px; height: 15px; background: var(--fg);
  vertical-align: middle; animation: blink 1.1s steps(1) infinite;
}

/* ---------- Sections ---------- */
.section { border-bottom: 1px solid var(--line); }
.section > .wrap { padding-block: 112px; }
.section-head { display: flex; flex-direction: column; gap: 16px; }
.section-head-row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
.section h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.15; }

.split { display: flex; flex-wrap: wrap; gap: 48px; }
.split > .label { flex: 1 1 240px; }
.split-body { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.body-muted { max-width: 40em; font-size: 17px; line-height: 1.7; color: var(--muted); }

/* Services */
.services {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.service {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg); padding: 36px 32px; min-height: 220px;
  display: flex; flex-direction: column; gap: 18px;
  transition: background-color .25s;
}
.service:hover { background: var(--surface); }
.service-top { display: flex; justify-content: space-between; align-items: center; color: var(--accent); }
.service .num { color: var(--dim); font-size: 12px; }
.service h3 { font-size: 22px; }
.service p { font-size: 15px; color: var(--muted); }
.service-cta { background: var(--surface); justify-content: space-between; }
.service-cta a { font-size: 22px; font-weight: 500; color: var(--accent); }
.service-cta a:hover { color: var(--fg); }

/* Portfolio slider */
.slider-nav { display: flex; gap: 8px; }
.icon-btn {
  width: 48px; height: 48px; background: transparent; color: var(--fg);
  border: 1px solid var(--line-strong); font-size: 18px; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.track {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - 48px) / 3);
  gap: 24px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; padding-bottom: 4px;
}
.track::-webkit-scrollbar { display: none; }
.work { scroll-snap-align: start; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.work-media {
  aspect-ratio: 16 / 9; max-width: 100%;
  background: #000; border: 1px solid var(--line); overflow: hidden;
}
/* contain = the whole image/video is always visible, never cropped */
.work-media img, .work-media video { width: 100%; height: 100%; object-fit: contain; }
.work:hover .work-media { border-color: var(--line-strong); }
.work-media { position: relative; }
.work-media video { cursor: pointer; }
.play-btn {
  position: absolute; right: 12px; bottom: 12px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11, 13, 16, 0.78); color: #E8EAED;
  border: 1px solid var(--line-strong); cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.play-btn:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.play-btn .i-pause { display: none; }
.work.is-playing .play-btn .i-play { display: none; }
.work.is-playing .play-btn .i-pause { display: block; }
.work-tag { font-family: var(--font-mono); font-size: 12px; color: var(--dim); }
.work h3 { font-size: 21px; }
.work p { font-size: 14.5px; line-height: 1.6; color: var(--muted); }

.media-missing {
  width: 100%; height: 100%; min-height: 96px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 12px; border: 1px dashed var(--line-strong);
  font-family: var(--font-mono); font-size: 12px; color: var(--dim); word-break: break-all;
}

/* Clients */
.clients {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 12px;
}
.client {
  height: 112px; padding: 20px;
  background: var(--tile);
  display: flex; align-items: center; justify-content: center;
  filter: grayscale(1); opacity: .82;
  transition: filter .3s, opacity .3s;
}
.client:hover { filter: none; opacity: 1; }
.client img { max-width: 100%; max-height: 100%; object-fit: contain; }
.client .media-missing { color: #4A5059; border-color: #B9C0C8; }

/* Contact */
.contact > .wrap { padding-block: 128px 112px; }
.contact-grid { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-end; }
.contact-grid > .stack { flex: 999 1 560px; min-width: 0; gap: 24px; }
.h1-like { font-size: clamp(40px, 6vw, 72px) !important; line-height: 1.02 !important; font-weight: 600 !important; letter-spacing: -0.035em; }
.facts { flex: 1 1 320px; min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 20px; }
.facts div { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 4px; }
.facts dt { font-family: var(--font-mono); font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 0; font-size: 15px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.footer-bar {
  padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; color: var(--dim);
}

/* Floating WhatsApp */
.floating-wa {
  position: fixed; z-index: 40;
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  transition: transform .2s, background-color .2s;
}
.floating-wa:hover { color: var(--on-accent); background: var(--fg); transform: translateY(-2px); }

/* ---------- Motion ---------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse, .cursor { animation: none; }
  .track { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  .track { grid-auto-columns: calc((100% - 24px) / 2); }
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  :root { --gutter: 20px; --header-h: 64px; }
  .menu-toggle { display: flex; order: 4; }
  .brand { order: 1; margin-right: auto; }
  .lang-switch { order: 2; }
  .theme-toggle { order: 3; width: 44px; height: 44px; }
  .header-bar { gap: 10px; }
  .lang-btn { min-height: 44px; padding: 0 10px; }
  .site-nav { order: 5; }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px max(var(--gutter), env(safe-area-inset-right, 0px)) 24px max(var(--gutter), env(safe-area-inset-left, 0px));
    font-family: var(--font-display);
  }
  .site-header.is-open .site-nav { display: flex; }
  .site-nav a:not(.btn) { color: var(--fg); font-size: 22px; font-weight: 500; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 20px; min-height: 52px; background: var(--accent); color: var(--on-accent); font-family: var(--font-display); font-size: 15px; font-weight: 600; }

  .hero { background-size: 40px 40px; }
  .hero-grid { padding-block: 56px; gap: 36px; }
  .lead { font-size: 16px; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
  .terminal { font-size: 12px; line-height: 1.9; }

  .section > .wrap { padding-block: 64px; }
  .contact > .wrap { padding-block: 72px 56px; }
  .stack { gap: 32px; }
  .split { gap: 20px; }
  .body-muted { font-size: 15px; }

  .services { border-left: 0; }
  .service { border-right: 0; }
  .service { min-height: 0; padding: 20px 0; border-bottom: 1px solid var(--line); gap: 6px; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; }
  .service:hover { background: var(--bg); }
  .service-top { grid-row: span 2; align-items: flex-start; padding-top: 5px; }
  .service-top svg { display: none; }
  .service h3 { font-size: 19px; }
  .service p { font-size: 14px; grid-column: 2; }
  .service-cta { display: flex; background: none; border-bottom: 0; padding-top: 24px; }
  .service-cta .num { display: none; }
  .service-cta a { font-size: 17px; }

  .slider-nav { display: none; }
  .track { grid-auto-columns: 82%; gap: 14px; }
  .clients { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .client { height: 88px; padding: 16px; }

  .footer-bar { flex-direction: column; gap: 6px; }
  .floating-wa { width: 52px; height: 52px; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* Desktop: nav + language switch sit together on the right */
@media (min-width: 821px) {
  .site-nav { margin-left: auto; }
}
/* Very small phones: flags only, to keep the header on one line */
/* Phones: flags only, so the brand name always has room */
@media (max-width: 520px) {
  .lang-btn span { display: none; }
  .lang-btn { padding: 0 9px; }
  .header-bar { gap: 8px; }
  /* safety net: the name shortens with "…" instead of being covered */
  .brand { min-width: 0; flex: 1 1 auto; gap: 10px; }
  .brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
}
@media (max-width: 400px) {
  :root { --gutter: 16px; }
  .brand { gap: 8px; }
  .brand-logo { width: 32px; height: 32px; }
  .brand-name { font-size: 16px; }
  .lang-btn { padding: 0 8px; }
  .theme-toggle, .menu-toggle { width: 42px; height: 42px; }
}
/* Very small screens (old phones, foldable cover screens) */
@media (max-width: 350px) {
  .brand { gap: 6px; }
  .brand-logo { width: 28px; height: 28px; }
  .brand-name { font-size: 14px; }
  .lang-btn { padding: 0 6px; }
  .header-bar { gap: 6px; }
  .theme-toggle, .menu-toggle { width: 40px; height: 40px; }
}
