/* ===========================================================================
   Optikal Development — v2 "datasheet / modular grid"
   Architectural grid: grotesk sans, hairline rules framing modular cells,
   cobalt accent used assertively. Deliberate contrast to the v1 serif build.
   =========================================================================== */

:root {
  --font-sans: "sofia-pro", "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
  --wrap: 1160px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --pad: clamp(20px, 3.4vw, 44px);
}

[data-theme="light"], :root {
  --page: #e8e7e2;
  --surface: #fbfbf9;
  --line: #12141a;          /* strong architectural hairline */
  --ink: #12141a;
  --muted: #565a63;
  --accent: #2540f0;
  --accent-ink: #ffffff;
  --accent-hover: #172ec2;
  --logo-filter: none;
}
[data-theme="dark"] {
  --page: #050506;
  --surface: #0d0e11;
  --line: #2c2f38;
  --ink: #f0f1f3;
  --muted: #969aa3;
  --accent: #6f86ff;
  --accent-ink: #0d0e11;
  --accent-hover: #93a5ff;
  --logo-filter: invert(1) brightness(1.8);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--page);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); color: var(--ink); padding: 10px 16px; z-index: 100; border: 1px solid var(--line); }
.skip-link:focus { left: 16px; top: 16px; }

/* ---------- The sheet (framed document) ---------- */
.sheet {
  max-width: var(--wrap);
  margin: clamp(18px, 4vw, 48px) auto;
  background: var(--surface);
  border: 1px solid var(--line);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--pad);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; }
.brand-mark { filter: var(--logo-filter); }
.sheet-nav { display: inline-flex; align-items: center; gap: 24px; }
.sheet-nav > a { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.sheet-nav > a:hover { color: var(--ink); }

.theme-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; transition: color 0.2s, border-color 0.2s; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.7; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.cell { padding: clamp(32px, 5vw, 68px) var(--pad); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin: 0 0 22px;
}
.tag .dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; display: inline-block; }
.hero-title {
  font-size: clamp(2.3rem, 5.4vw, 4.3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.0;
  margin: 0 0 24px;
  max-width: 15ch;
}
.hero-lead { font-size: clamp(1rem, 1.35vw, 1.14rem); color: var(--muted); max-width: 48ch; margin: 0 0 32px; }
.hero-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hero-mark img { width: 100%; max-width: 320px; margin-left: auto; filter: var(--logo-filter); }

/* ---------- Buttons / links ---------- */
.btn {
  display: inline-flex; align-items: center;
  background: var(--accent); color: var(--accent-ink);
  padding: 13px 26px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid var(--accent);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.link { color: var(--ink); font-weight: 600; font-size: 0.95rem; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.link:hover { color: var(--accent); }
.link.big { font-size: 1.05rem; }

/* ---------- What we do (3 cells) ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.do { border-left: 1px solid var(--line); }
.do:first-child { border-left: 0; }
.idx { display: block; font-size: 0.85rem; font-weight: 700; color: var(--accent); margin-bottom: 20px; letter-spacing: 0.02em; }
.do h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
.do p { color: var(--muted); font-size: 0.98rem; margin: 0; }

/* ---------- Flagship ---------- */
.flagship {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.flagship-name { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 700; letter-spacing: -0.04em; line-height: 0.95; margin: 6px 0 22px; }
.flagship-desc { color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.16rem); max-width: 52ch; margin: 0; }

/* ---------- Contact ---------- */
.contact { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.contact-title { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -0.03em; margin: 0 0 12px; }
.contact-lead { color: var(--muted); max-width: 40ch; margin: 0; }
.contact-email { font-size: clamp(1.15rem, 2.4vw, 1.7rem); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); border-bottom: 2px solid var(--accent); padding-bottom: 3px; }
.contact-email:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.sheet-footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  padding: 22px var(--pad);
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.86rem;
}
.footer-links { display: inline-flex; gap: 22px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-mark { order: -1; }
  .hero-mark img { max-width: 150px; margin: 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .do { border-left: 0; border-top: 1px solid var(--line); }
  .do:first-child { border-top: 0; }
  .flagship { grid-template-columns: 1fr; }
  .contact { flex-direction: column; align-items: flex-start; }
}
