/* ==========================================================================
   Techotsu — global stylesheet
   ========================================================================== */

/* JetBrains Mono — self-hosted, OFL-1.1 licensed (see assets/fonts/OFL.txt).
   Used ONLY as a technical accent: terminal UI, code snippets, small
   technical labels/stats. Everything else stays on --font. */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/JetBrainsMono-Bold.woff2') format('woff2');
}

:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --bg-dark: #0a0e1f;
  --bg-dark-alt: #10162c;
  --text: #12172b;
  --text-muted: #545b70;
  --text-on-dark: #eef1fb;
  --text-on-dark-muted: #a6adc7;
  --accent: #1c6dd0;
  --accent-2: #14b8a6;
  --accent-soft: #e8f0fd;
  --border: #e2e5ec;
  --border-dark: #232a44;
  --live: #14b8a6;
  --dev: #8a90a6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(18, 23, 43, 0.04), 0 8px 24px rgba(18, 23, 43, 0.06);
  --max-width: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.section-head {
  max-width: 640px;
  margin: 0 0 40px;
}

.section-head h2 {
  font-size: clamp(28px, 3.4vw, 36px);
  margin-top: 10px;
}

.section-head p {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 17px;
}
.section-head-split {
  max-width: none;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: center;
}
.section-head-photo img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

section { padding: 88px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #1558ab; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-on-dark {
  background: var(--accent-2);
  color: #052e2a;
}
.btn-on-dark:hover { background: #10a394; }

.btn-sm { padding: 9px 16px; font-size: 14px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.brand svg { width: 30px; height: 30px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
}
.nav-links a { color: var(--text-muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav-links a:hover { color: var(--text); border-bottom-color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: none;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 31, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  z-index: 200;
}
.search-overlay.open { display: flex; }
.search-box {
  background: #fff;
  width: min(560px, 92vw);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.search-box input {
  width: 100%;
  font-size: 17px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}
.search-box input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.search-results { margin-top: 14px; max-height: 40vh; overflow-y: auto; }
.search-results a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
}
.search-results a:hover { background: var(--bg-alt); }
.search-hint { color: var(--text-muted); font-size: 13px; margin-top: 12px; }
.search-close { float: right; background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 14px; }

/* ---------- Hero ---------- */
.hero {
  padding: 76px 0 60px;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 54px);
}
.hero .sub {
  margin-top: 22px;
  font-size: 18px;
  color: var(--text-muted);
  max-width: 52ch;
}
.hero-cta { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-art { display: flex; flex-direction: column; }
.hero-art img { border-radius: 20px; overflow: hidden; }

/* ---------- Hero terminal (live typing animation) ---------- */
.hero-terminal {
  background: #12141d;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(10, 14, 31, 0.45), 0 1px 1px rgba(0,0,0,.2);
  border: 1px solid #232840;
}
.term-titlebar {
  height: 38px;
  background: #0d0f18;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid #1c2036;
}
.term-dot { width: 11px; height: 11px; border-radius: 50%; }
.term-dot.r { background: #ff5f56; }
.term-dot.y { background: #ffbd2e; }
.term-dot.g { background: #27c93f; }
.term-title {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #7d84a3;
}
.term-body {
  padding: 22px 20px 26px;
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.8;
  min-height: 170px;
}
.term-line { color: #d6deeb; white-space: pre-wrap; word-break: break-all; }
.term-prompt { color: #82aaff; }
.term-cursor {
  color: #8fd19e;
  animation: term-blink 1s step-end infinite;
}
.term-cursor.hide { visibility: hidden; }
.term-result {
  margin-top: 14px;
  color: #aab2d5;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .4s ease, transform .4s ease;
}
.term-result.show { opacity: 1; transform: translateY(0); }
.term-ok { color: #8fd19e; font-weight: 700; }
.term-highlight { color: #ffcb6b; }
.term-caption {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

@keyframes term-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .term-cursor { animation: none; }
}

/* ---------- Stat bar ---------- */
.stat-bar {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 0;
}
.stat-bar .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.stat {
  padding: 40px 24px;
  text-align: center;
  border-left: 1px solid var(--border);
}
.stat:first-child { border-left: none; }
.stat .num {
  font-family: var(--font-mono);
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.stat .label {
  margin-top: 8px;
  font-size: 14.5px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ---------- Capability grid ---------- */
.cap-grid, .services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.cap-card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.cap-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.cap-card .icon svg { width: 22px; height: 22px; }
.cap-card h3 { font-size: 17px; }
.cap-card p { margin-top: 8px; color: var(--text-muted); font-size: 14.5px; }

/* ---------- Code showcase (real screenshots, not stock) ---------- */
.code-showcase { margin-top: 64px; }
.code-showcase-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 22px;
  letter-spacing: 0.02em;
}
.code-showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.code-shot {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #12141d;
  transition: transform .2s ease, box-shadow .2s ease;
}
.code-shot:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -16px rgba(18,23,43,0.25); }
.code-shot img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: top;
  display: block;
}
.code-shot figcaption {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.code-shot-wide {
  grid-column: 1 / -1;
}
.code-shot-wide img { height: 380px; }

/* ---------- Industries grid ---------- */
.bg-alt { background: var(--bg-alt); }

.ind-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.ind-card {
  position: relative;
  padding: 26px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ind-card.flagship {
  border-color: var(--accent-2);
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 55%);
  grid-column: span 3;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.ind-card.flagship .ind-body {
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ind-card.flagship .ind-icon { width: 56px; height: 56px; margin-bottom: 6px; }
.ind-photo { flex-shrink: 0; width: 320px; align-self: stretch; }
.ind-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block; }
.ind-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.ind-icon svg { width: 24px; height: 24px; }
.flagship .ind-icon svg { width: 32px; height: 32px; }
.ind-card h3 { font-size: 17px; }
.ind-card p { color: var(--text-muted); font-size: 14.5px; margin-top: 4px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
  width: fit-content;
}
.badge-live { background: #ccfbf1; color: #0f766e; }
.badge-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #0f766e; }
.badge-dev { background: #eef0f5; color: #5a6079; }
.ind-body { flex: 1; }

/* ---------- Research section ---------- */
.research {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 96px 0;
}
.research .eyebrow { color: var(--accent-2); }
.research-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.research h2 {
  font-size: clamp(28px, 3.4vw, 36px);
  margin-top: 10px;
  color: #fff;
}
.research .lede {
  margin-top: 16px;
  font-size: 18px;
  color: var(--text-on-dark-muted);
}
.research-note {
  margin-top: 20px;
  padding: 16px 18px;
  border-left: 3px solid var(--accent-2);
  background: rgba(20, 184, 166, 0.08);
  font-size: 14.5px;
  color: var(--text-on-dark);
  border-radius: 0 8px 8px 0;
}
.research-panel {
  background: var(--bg-dark-alt);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 28px;
}
.research-panel h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-on-dark-muted);
  margin-bottom: 16px;
}
.data-sources { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.data-sources li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  padding: 10px 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border-dark);
  border-radius: 8px;
}
.data-sources li svg { width: 16px; height: 16px; color: var(--accent-2); flex-shrink: 0; }
.research-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.15);
  color: var(--accent-2);
}

/* ---------- Services ---------- */
.services-grid .cap-card { background: var(--bg-alt); }

/* ---------- Partners / CTA ---------- */
.cta {
  background: linear-gradient(135deg, #103a7a 0%, #0a0e1f 100%);
  color: #fff;
  border-radius: 24px;
  padding: 64px 48px;
  text-align: center;
  margin: 0 24px;
}
.cta-wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.cta h2 { font-size: clamp(26px, 3.2vw, 34px); color: #fff; }
.cta p { margin-top: 14px; color: #c7d0ea; max-width: 56ch; margin-left: auto; margin-right: auto; font-size: 16.5px; }
.cta .btn-group { margin-top: 28px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-on-dark-muted);
  margin-top: 96px;
  padding: 64px 0 28px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-dark);
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: #fff; }
.footer-brand svg { width: 26px; height: 26px; }
.footer-tag { margin-top: 14px; font-size: 14.5px; max-width: 34ch; }
.footer-col h5 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6d7591;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; font-size: 14.5px; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13.5px;
}
.footer-legal { display: flex; gap: 20px; }
.footer-legal a:hover { color: #fff; }

/* ---------- Simple pages (stubs) ---------- */
.simple-page { padding: 88px 0 120px; }
.simple-page .container { max-width: 720px; }
.simple-page .eyebrow { margin-bottom: 14px; }
.simple-page h1 { font-size: clamp(30px, 4vw, 42px); }
.simple-page .lede { margin-top: 18px; font-size: 18px; color: var(--text-muted); }
.status-box {
  margin-top: 36px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
}
.status-box h3 { font-size: 16px; }
.status-box p { margin-top: 8px; color: var(--text-muted); font-size: 15px; }
.simple-page .back-link { margin-top: 40px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); }

/* login form (stub) */
.login-form { margin-top: 32px; display: flex; flex-direction: column; gap: 14px; max-width: 380px; }
.login-form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  background: #f3f4f7;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .research-inner { grid-template-columns: 1fr; }
  .section-head-split { grid-template-columns: 1fr; gap: 24px; }
  .section-head-photo img { height: 220px; }
  .section-head-photo { order: -1; }
  .cap-grid, .services-grid { grid-template-columns: repeat(2, 1fr); }
  .ind-grid { grid-template-columns: repeat(2, 1fr); }
  .ind-card.flagship { grid-column: span 2; flex-direction: column; align-items: stretch; }
  .ind-photo { width: 100%; height: 200px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .code-showcase-grid { grid-template-columns: repeat(2, 1fr); }
  .code-shot-wide { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .stat-bar .container { grid-template-columns: 1fr; }
  .stat { border-left: none; border-top: 1px solid var(--border); }
  .stat:first-child { border-top: none; }
  .cap-grid, .services-grid, .ind-grid { grid-template-columns: 1fr; }
  .ind-card.flagship { grid-column: span 1; }
  .ind-photo { height: 170px; }
  .code-showcase-grid { grid-template-columns: 1fr; }
  .code-shot-wide img { height: 260px; }
  .term-body { font-size: 13px; padding: 18px 16px 22px; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .cta { padding: 48px 24px; margin: 0 16px; }
  section { padding: 64px 0; }
}

@media (max-width: 720px) {
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav-links.open a { width: 100%; padding: 10px 0; }
}
