@import url("tokens.css");

/* Naska-IT studio site — premium, dependency-free design system.
   Tokens live in tokens.css. This file styles the site on top of them:
   Geist display type, light/dark, double-bezel depth, spring motion. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a { color: var(--accent-strong); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- scroll-reveal motion ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(5px);
  transition: opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out),
    filter var(--dur-slow) var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.02em;
}
.brand .wordmark { height: 24px; width: auto; display: block; }

/* Theme-aware logo swap: navy wordmark on light, white wordmark on dark. */
.logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .logo-dark { display: none; }
  :root:not([data-theme]) .logo-light { display: block; }
}
.nav { display: flex; align-items: center; gap: 22px; }
/* :not(.btn) so the CTA button keeps its own colours — a plain `.nav a` rule
   would out-specify `.btn-primary` and force dark text onto the button. */
.nav a:not(.btn) { color: var(--text-soft); text-decoration: none; font-size: 15px; font-weight: 500; transition: color var(--dur-fast) var(--ease); }
.nav a:not(.btn):hover { color: var(--accent-strong); }

/* theme toggle */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex: none; padding: 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-soft);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.theme-toggle:hover { color: var(--accent-strong); border-color: var(--accent); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle svg { display: block; }
.theme-toggle .i-sun { display: none; }
.theme-toggle[data-mode="dark"] .i-sun { display: block; }
.theme-toggle[data-mode="dark"] .i-moon { display: none; }

/* icon link (e.g. GitHub badge) — matches the toggle */
.icon-link {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-soft);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.icon-link:hover { color: var(--accent-strong); border-color: var(--accent); }
.icon-link:active { transform: scale(.92); }
.icon-link svg { display: block; }
.footer-links .gh { display: inline-flex; align-items: center; gap: 6px; }
.footer-links .gh svg { display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease),
    filter var(--dur-fast) var(--ease);
}
.btn:active { transform: scale(.985) translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-grad { background: var(--grad); color: #fff; border: none; box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.btn-grad:hover { filter: brightness(1.05); box-shadow: var(--glow), 0 10px 26px color-mix(in srgb, var(--accent) 32%, transparent); }
.btn-ghost { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-lg { padding: 14px 26px; font-size: 16px; }

.btn-ico {
  display: grid; place-items: center;
  width: 1.55em; height: 1.55em;
  margin-left: .15em; margin-right: -.35em;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, currentColor 16%, transparent);
  font-size: .86em; line-height: 1;
  transition: transform var(--dur) var(--ease);
}
.btn:hover .btn-ico { transform: translate(2px, -1px); }

/* ---------- hero (technical — copy + console, on a blueprint grid) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 72px;
}
/* brand glow */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(55% 50% at 18% -8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(45% 55% at 98% 0%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 70%);
  pointer-events: none;
}
/* "naska lines" — faint blueprint grid, faded out toward the edges */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--hairline) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hairline) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(125% 95% at 50% 0%, #000 30%, transparent 80%);
  mask-image: radial-gradient(125% 95% at 50% 0%, #000 30%, transparent 80%);
  opacity: .55;
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: center;
}
.hero-copy { text-align: left; }
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .04em;
  padding: 6px 13px;
  border-radius: var(--r-sm);
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.eyebrow-pill.mono { font-family: var(--font-mono); letter-spacing: 0; }
.eyebrow-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 50%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 20px;
}
.hero h1 em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede {
  font-size: clamp(16.5px, 1.5vw, 19px);
  color: var(--text-soft);
  max-width: 54ch;
  margin: 0 0 30px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }

/* ---------- console / terminal ---------- */
.terminal {
  background: #0a0d17;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, #05070d);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px;
  background: #11151f;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.term-bar .tdot { width: 11px; height: 11px; border-radius: 50%; background: #2a2f40; }
.term-bar .tdot:nth-child(1) { background: #ef5f5f; }
.term-bar .tdot:nth-child(2) { background: #e6b34a; }
.term-bar .tdot:nth-child(3) { background: #4fcf6d; }
.term-title { margin-left: 8px; color: #6b7280; font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em; }
.term-body {
  margin: 0;
  padding: 18px 18px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  color: #c3c8d4;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-body .tp { color: var(--accent-2); }                 /* prompt */
.term-body .to { color: #97a0b3; }                          /* command output */
.term-body .tk { color: #7fe0c0; font-weight: 600; }        /* highlighted token */
.cursor {
  display: inline-block; width: 8px; height: 15px;
  background: var(--accent-2); vertical-align: -2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- metrics strip (dashboard cells) ---------- */
.stats {
  margin-top: 54px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  overflow: hidden;
}
.stat { background: var(--bg); padding: 22px 24px; display: flex; flex-direction: column; gap: 7px; }
.stat-num { font-family: var(--font-mono); font-size: clamp(26px, 3vw, 34px); font-weight: 600; letter-spacing: -.02em; color: var(--text); line-height: 1; }
.stat-num .u { font-size: .5em; color: var(--accent-strong); margin-left: 3px; letter-spacing: 0; }
.stat-label { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: .02em; }

/* ---------- sections ---------- */
section { padding: 92px 0; }
section.alt { background: var(--bg-alt); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.section-head h2 { font-size: clamp(27px, 3.6vw, 38px); letter-spacing: -0.03em; margin: 0 0 14px; }
.section-head p { color: var(--text-soft); font-size: 17px; margin: 0; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--hairline);
  padding: 5px 11px;
  border-radius: var(--r-xs);
  margin: 0 0 16px;
}
.eyebrow::before { content: "// "; opacity: .55; }

/* ---------- machined card (shared base) ---------- */
.card, .service, .product {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow), var(--inset-hi);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

/* ---------- two-pillar split (studio + services) ---------- */
.pillars { display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); }
.pillar {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow), var(--inset-hi);
  padding: 34px;
  position: relative;
  overflow: hidden;
}
.pillar::before {
  content: "";
  position: absolute; left: 0; top: 0; right: 0; height: 3px;
  background: var(--grad);
}
.pillar .kicker { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); }
.pillar .kicker::before { content: "▸ "; }
.pillar h3 { margin: 10px 0 10px; font-size: 22px; }
.pillar p { margin: 0; color: var(--text-soft); font-size: 15.5px; }

/* ---------- services grid ---------- */
.services { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); counter-reset: svc; }
.service { padding: 26px; position: relative; counter-increment: svc; }
.service::before {
  content: "0" counter(svc);
  position: absolute; top: 20px; right: 22px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--muted); opacity: .65;
}
.service:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg), var(--inset-hi); border-color: color-mix(in srgb, var(--accent) 30%, var(--hairline)); }
.service .ico {
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: grid; place-items: center; margin-bottom: 16px;
  background: var(--grad-soft);
  color: var(--accent-strong);
  border: 1px solid var(--hairline);
}
.service .ico svg { display: block; }
.service h3 { margin: 0 0 8px; font-size: 18px; }
.service p { margin: 0; color: var(--text-soft); font-size: 15px; }

/* ---------- value / how-we-work list ---------- */
.values { display: grid; gap: 16px 32px; grid-template-columns: repeat(2, 1fr); }
.value { display: flex; gap: 12px; align-items: flex-start; }
.value .tick {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-strong);
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
  margin-top: 2px; border: 1px solid var(--hairline);
}
.value h4 { margin: 0 0 2px; font-size: 15.5px; }
.value p { margin: 0; color: var(--text-soft); font-size: 14.5px; }

/* ---------- products ---------- */
.products { display: grid; gap: 22px; }
.product {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 30px 32px;
}
.product .tag {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--hairline);
  padding: 4px 11px; border-radius: var(--r-xs);
  margin-bottom: 6px;
}
.product h3 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.product p { margin: 6px 0 0; color: var(--text-soft); font-size: 15.5px; max-width: 70ch; }
.product .links { margin-top: 16px; display: flex; gap: 14px; flex-wrap: wrap; }
.product .links a { font-weight: 600; font-size: 14.5px; text-decoration: none; }
.product .links a:hover { text-decoration: underline; }
.product.soon { opacity: .92; border-style: dashed; box-shadow: var(--shadow-sm); }
.product.soon .tag { color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent); }

/* ---------- contact band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  background: var(--grad);
  color: #fff;
  text-align: center;
  border-radius: var(--r-xl);
  padding: 56px 28px;
  box-shadow: var(--shadow-accent);
}
.cta-band h2 { margin: 0 0 12px; font-size: clamp(26px, 3.6vw, 38px); letter-spacing: -.03em; color: #fff; }
.cta-band p { margin: 0 auto 26px; max-width: 540px; font-size: 17px; color: rgba(255,255,255,.9); }
.cta-band .btn-light { background: #fff; color: var(--accent-strong); }
.cta-band .btn-light:hover { background: #fff; filter: brightness(.97); box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.cta-mail { margin: 16px 0 0; font-family: var(--font-mono); font-size: 14.5px; }
.cta-mail a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.45); padding-bottom: 1px; }
.cta-mail a:hover { border-color: #fff; }

/* ---------- footer (intentionally dark in both themes) ---------- */
.site-footer { background: var(--footer-bg); color: #aeb6c7; padding: 56px 0 36px; font-size: 14.5px; }
.site-footer a { color: #d7dceb; text-decoration: none; transition: color var(--dur-fast) var(--ease); }
.site-footer a:hover { color: #fff; }
.footer-top { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; margin-bottom: 28px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { height: 26px; width: auto; display: block; }
.footer-tagline { max-width: 320px; color: #8b93a5; margin: 10px 0 0; font-size: 13.5px; }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-bottom { border-top: 1px solid #232a3a; padding-top: 22px; color: #7c8499; font-size: 13px; }
.footer-bottom p { margin: 0 0 8px; }
.footer-bottom .legal-entity { color: #8b93a5; font-size: 12.5px; line-height: 1.5; }
.footer-bottom .legal-entity strong { color: #aeb6c7; font-weight: 600; }

/* ---------- legal pages ---------- */
.legal { padding: 64px 0 80px; }
.legal .wrap { max-width: 780px; }
.legal h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; margin: 0 0 6px; }
.legal .updated { color: var(--muted); font-size: 14px; margin: 0 0 32px; }
.legal h2 { font-size: 21px; margin: 36px 0 10px; letter-spacing: -.02em; }
.legal h3 { font-size: 17px; margin: 22px 0 6px; }
.legal p, .legal li { color: var(--text-soft); font-size: 15.5px; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal .callout {
  background: var(--accent-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin: 22px 0;
  color: var(--text-soft);
  font-size: 15px;
}
.legal .info-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.legal .info-table th, .legal .info-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.legal .info-table th { width: 38%; color: var(--text); font-weight: 600; }
.legal .info-table td { color: var(--text-soft); }
.back-link { display: inline-block; margin-top: 36px; font-weight: 600; text-decoration: none; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: 1fr; }
  .services { grid-template-columns: 1fr; }
  .values { grid-template-columns: 1fr; }
  .nav { gap: 14px; }
  .nav a:not(.btn):not(.icon-link) { display: none; }
  section { padding: 72px 0; }
}
@media (max-width: 520px) {
  section { padding: 56px 0; }
  .hero { padding: 64px 0 52px; }
  /* The hero + contact already carry the CTA — drop the cramped header one. */
  .site-header .btn-primary { display: none; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .cta-band { padding: 40px 20px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
