/* ============================================================
   KO2U — Modern & Minimal One-Page Site
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg:          #0b0e14;
  --bg-alt:      #0f131c;
  --bg-card:     #141926;
  --border:      #1f2636;
  --text:        #e6e9f0;
  --text-dim:    #8b93a7;
  --accent:      #5eead4;   /* teal */
  --accent-2:    #818cf8;   /* indigo */
  --accent-soft: rgba(94, 234, 212, 0.08);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
  --radius: 14px;
  --maxw: 1080px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(11, 14, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.logo-mark {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.95rem;
}

.logo-text em { color: var(--accent); font-style: normal; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.92rem;
  color: var(--text-dim);
}

.nav-links a:not(.btn):hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #06281f;
}

.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(94, 234, 212, 0.25);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 15px 32px; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 20%, rgba(129, 140, 248, 0.12), transparent),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(94, 234, 212, 0.08), transparent);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 75%);
}

.hero-inner { position: relative; }

.hero-kicker {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero-title .accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 560px;
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 64px;
  flex-wrap: wrap;
}

.stat { display: flex; flex-direction: column; }

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}

.stat-label { color: var(--text-dim); font-size: 0.85rem; }

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }

.section-head { margin-bottom: 56px; }

.section-kicker {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}

/* Prevent grid blowout from long code lines on mobile */
.about-grid > * { min-width: 0; }

.about-text p { color: var(--text-dim); margin-bottom: 18px; }
.about-text strong { color: var(--text); }
.about-text em { color: var(--accent); font-style: normal; }

/* Code window */
.code-window {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.code-titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: #161b22;
  border-bottom: 1px solid var(--border);
}

.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.code-filename {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.code-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-x: auto;
  max-width: 100%;
  color: #c9d1d9;
}

.c-kw  { color: #ff7b72; }
.c-str { color: #a5d6ff; }
.c-type{ color: #79c0ff; }
.c-cm  { color: #6e7681; font-style: italic; }
.c-fn  { color: #d2a8ff; }
.c-num { color: #ffa657; }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.2s, border-color 0.2s;
}

.service-card:hover {
  transform: translateY(-4px);
  border-color: rgba(94, 234, 212, 0.4);
}

.service-icon {
  font-size: 1.6rem;
  margin-bottom: 16px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 12px;
}

.service-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.service-card p { color: var(--text-dim); font-size: 0.92rem; }

/* ---------- Expertise ---------- */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.tech-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s;
}

.tech-item:hover { border-color: rgba(129, 140, 248, 0.5); }

.tech-name { font-family: var(--font-mono); font-weight: 600; font-size: 0.95rem; }
.tech-desc { color: var(--text-dim); font-size: 0.8rem; }

/* ---------- Process ---------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.process-step { position: relative; padding-top: 8px; }

.step-num {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
  display: block;
  margin-bottom: 14px;
}

.process-step h3 { font-size: 1rem; margin-bottom: 8px; }
.process-step p { color: var(--text-dim); font-size: 0.9rem; }

/* ---------- Contact ---------- */
.contact { background: var(--bg-alt); }

.contact-inner {
  text-align: center;
  max-width: 640px;
}

.contact-inner h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.contact-sub { color: var(--text-dim); margin-bottom: 32px; }

.contact-meta {
  margin-top: 28px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.contact-meta .sep { margin: 0 10px; color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-logo { font-weight: 700; }
.footer-logo em { color: var(--accent); font-style: normal; }
.footer-copy { color: var(--text-dim); font-size: 0.82rem; }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible { opacity: 1; transform: none; }

/* Prevent horizontal overflow on small screens */
.services-grid > *,
.tech-grid > *,
.process-grid > * { min-width: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .section { padding: 72px 0; }
  .hero { padding-top: 100px; }
  .hero-stats { gap: 28px; }

  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 64px;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: center;
    padding: 28px 0;
    gap: 20px;
    background: rgba(11, 14, 20, 0.97);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
  }

  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }

  .services-grid,
  .tech-grid,
  .process-grid { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
}
