/* ═══════════════════════════════════════════════════════════════
   TAIVAL TECH OY — Design System
   Palette: #0A0A0A | #FFFFFF | #1E6FFF | #1A1A1A
   Font: Inter
   Brand: Direct. Concrete. No fluff.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:        #0A0A0A;
  --bg-card:   #111111;
  --bg-raised: #161616;
  --border:    rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --text:      #FFFFFF;
  --text-muted: rgba(255,255,255,0.5);
  --text-dim:  rgba(255,255,255,0.35);
  --accent:    #1E6FFF;
  --accent-hover: #3B84FF;
  --accent-dim: rgba(30,111,255,0.12);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm:  2px;
  --radius-md:  4px;
  --radius-lg:  6px;

  --nav-h: 64px;
  --container: 1200px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

ul, ol { list-style: none; }

/* ─── Container ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .container { padding: 0 40px; }
}
@media (min-width: 1200px) {
  .container { padding: 0 64px; }
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn--outline:hover {
  border-color: var(--text);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 12px 0;
}
.btn--ghost:hover {
  color: var(--text);
}

.btn--full {
  width: 100%;
  justify-content: center;
}

/* ─── Section Label ──────────────────────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

/* ═══ NAV ═══════════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.nav.scrolled {
  background: rgba(10,10,10,0.95);
  border-color: var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .nav__inner { padding: 0 40px; }
}
@media (min-width: 1200px) {
  .nav__inner { padding: 0 64px; }
}

.nav__logo {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.nav__cta {
  font-size: 0.8125rem;
  padding: 9px 18px;
}

/* ═══ HERO ═══════════════════════════════════════════════════════════ */
.hero {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
  overflow: hidden;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    padding: calc(var(--nav-h) + 80px) 64px 80px;
    max-width: var(--container);
    margin: 0 auto;
  }
}

.hero__content {
  padding: 80px 24px 40px;
  max-width: 600px;
}

@media (min-width: 900px) {
  .hero__content {
    padding: 0;
  }
}

.hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.hero__headline {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 28px;
  color: var(--text);
}

.hero__accent {
  color: var(--accent);
  font-style: italic;
  font-weight: 300;
}

.hero__sub {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 44px;
  max-width: 440px;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Hero Visual */
.hero__visual {
  display: none;
  position: relative;
}

@media (min-width: 900px) {
  .hero__visual {
    display: block;
  }
}

.hero__img-wrap {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  position: relative;
}

/* Fallback when image is missing */
.hero__img-wrap--fallback {
  background:
    linear-gradient(135deg, #111 0%, #1a1a1a 50%, #0d1a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__img-wrap--fallback::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(30,111,255,0.04) 39px,
      rgba(30,111,255,0.04) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(30,111,255,0.04) 39px,
      rgba(30,111,255,0.04) 40px
    );
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.hero__img-wrap:hover .hero__img {
  transform: scale(1.02);
}

.hero__img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10,10,10,0.2) 0%,
    transparent 60%
  );
  pointer-events: none;
}

/* Hero stats */
.hero__stat {
  position: absolute;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
}

.hero__stat--1 {
  bottom: -16px;
  left: -20px;
}

.hero__stat--2 {
  top: -16px;
  right: -20px;
}

.hero__stat-num {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--accent);
}

.hero__stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ═══ SERVICES ═══════════════════════════════════════════════════════ */
.services {
  padding: 120px 0 100px;
  border-top: 1px solid var(--border);
}

.services__intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 72px;
}

@media (min-width: 768px) {
  .services__intro {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: end;
  }
}

.services__heading {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.services__lead {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 480px;
}

/* Service rows (editorial style) */
.services__list {
  display: flex;
  flex-direction: column;
}

.service-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 48px 0;
  border-top: 1px solid var(--border);
  transition: border-color 0.2s;
}

.service-row:last-child {
  border-bottom: 1px solid var(--border);
}

.service-row:hover {
  border-top-color: var(--border-strong);
}

@media (min-width: 768px) {
  .service-row {
    grid-template-columns: 240px 1fr;
    gap: 60px;
    align-items: start;
  }
}

.service-row__meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.service-row__num {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.service-row__tag {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.service-row__body h3 {
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  line-height: 1.25;
}

.service-row__body p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.service-row__deliverables {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-row__deliverables li {
  font-size: 0.8125rem;
  color: var(--text-dim);
  padding-left: 16px;
  position: relative;
}

.service-row__deliverables li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ═══ PROCESS ═══════════════════════════════════════════════════════ */
.process {
  padding: 100px 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.process__heading {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 60px;
}

.process__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 60px;
  align-items: start;
}

@media (min-width: 900px) {
  .process__layout {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
  }
}

.process__steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.process__step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.process__step:first-child {
  border-top: 1px solid var(--border);
}

.process__step-num {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 4px;
}

.process__step-content h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.process__step-content p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* Process visual */
.process__visual {
  position: relative;
}

.process__img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* Fallback when process image is missing */
.process__visual--fallback .process__img {
  display: none;
}

.process__visual--fallback {
  aspect-ratio: 4/3;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.process__visual--fallback::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      rgba(30,111,255,0.03) 8px,
      rgba(30,111,255,0.03) 9px
    );
}

.process__visual--fallback::after {
  content: 'Process Image';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.process__visual-caption {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  font-style: italic;
}

/* ═══ WHY US ═════════════════════════════════════════════════════════ */
.why {
  padding: 100px 0;
}

.why__heading {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 60px;
}

.why__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 48px;
}

@media (min-width: 600px) {
  .why__grid { grid-template-columns: 1fr 1fr; }
}

.why__stat {
  background: var(--bg);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.why__stat:hover {
  background: var(--bg-card);
}

.why__stat-num {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}

.why__stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}

.why__stat-context {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-top: 8px;
}

.why__note {
  border-top: 1px solid var(--border);
  padding-top: 32px;
}

.why__note p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 600px;
}

/* ═══ CONTACT ════════════════════════════════════════════════════════ */
.contact {
  padding: 100px 0 120px;
  border-top: 1px solid var(--border);
}

.contact__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 60px;
  align-items: start;
}

@media (min-width: 900px) {
  .contact__layout {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
  }
}

.contact__heading {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.contact__sub {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.contact__email {
  display: block;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  transition: color 0.15s;
}

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

.contact__location {
  font-size: 0.8125rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9375rem;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
  -webkit-appearance: none;
  border-radius: 0;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-dim);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: -4px;
}

/* ═══ FOOTER ══════════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 32px;
  justify-content: space-between;
}

.footer__logo {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.footer__meta {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.footer__copy {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* ═══ NAV SCROLL EFFECT (JS adds .scrolled) ═════════════════════════ */
/* Already defined above in .nav.scrolled */

/* ═══ SCROLL REVEAL (JS adds .visible) ══════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ═══ RESPONSIVE TWEAKS ══════════════════════════════════════════════ */
@media (max-width: 600px) {
  .why__stat {
    padding: 28px 24px;
  }

  .hero__content {
    padding: 60px 24px 32px;
  }

  .hero__headline {
    font-size: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__img { transition: none; }
}
