/*
Theme Name: Moontech
Theme URI: https://www.moontech.fi
Author: Moontech
Description: Custom WordPress theme for Moontech Marketing & Software Studio
Version: 1.0.0
Text Domain: moontech
*/

:root {
  /* midnight shell */
  --bg:        oklch(0.16 0.018 256);
  --bg-2:      oklch(0.19 0.02 256);
  --surface:   oklch(0.22 0.022 256);
  --surface-2: oklch(0.26 0.024 256);
  --line:      oklch(0.32 0.022 256);
  --line-soft: oklch(0.28 0.02 256 / 0.6);
  --ink:       oklch(0.97 0.008 256);
  --ink-2:     oklch(0.82 0.012 256);
  --ink-3:     oklch(0.64 0.014 256);
  --silver:    oklch(0.86 0.03 256);

  /* per-brand accents — shared chroma/lightness, hue varies */
  --kasvuly:  oklch(0.80 0.14 152);
  --pathclip: oklch(0.80 0.14 248);
  --aist:     oklch(0.80 0.14 300);

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

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ambient field behind everything */
.stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.stars canvas { width: 100%; height: 100%; display: block; }
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 78% -10%, oklch(0.80 0.14 248 / 0.10), transparent 60%),
    radial-gradient(50vw 50vw at 10% 110%, oklch(0.80 0.14 300 / 0.08), transparent 60%);
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; position: relative; z-index: 2; }

.mono {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

h1, h2, h3 { font-family: "Space Grotesk", sans-serif; font-weight: 600; line-height: 1.04; letter-spacing: -0.02em; }

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

/* ---------- NAV ---------- */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s var(--ease);
  border-bottom: 1px solid transparent;
}
header.scrolled {
  background: oklch(0.16 0.018 256 / 0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.brand .moon {
  width: 22px; height: 22px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, oklch(0.98 0.01 256), oklch(0.80 0.03 256) 55%, oklch(0.55 0.03 256) 100%);
  box-shadow: 0 0 18px oklch(0.86 0.03 256 / 0.5), inset -3px -3px 6px oklch(0.40 0.03 256 / 0.6);
}
.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a.link { font-size: 15px; color: var(--ink-2); transition: color .2s; }
.nav-links a.link:hover { color: var(--ink); }
.nav-cta {
  font-family: "Space Grotesk"; font-weight: 500; font-size: 15px;
  padding: 10px 20px; border-radius: 100px; color: var(--bg);
  background: var(--silver); transition: transform .2s var(--ease), box-shadow .3s;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 30px oklch(0.86 0.03 256 / 0.25); }
.menu-btn { display: none; }

/* ---------- HERO ---------- */
.hero { position: relative; padding: 184px 0 120px; }
.hero .moon-big {
  position: absolute; top: 70px; right: -70px; width: 360px; height: 360px; border-radius: 50%;
  background:
    radial-gradient(circle at 36% 32%, oklch(0.97 0.008 256), oklch(0.84 0.02 256) 42%, oklch(0.55 0.025 256) 78%, oklch(0.40 0.03 256) 100%);
  box-shadow: 0 0 120px oklch(0.80 0.06 256 / 0.35), inset -26px -26px 70px oklch(0.30 0.03 256 / 0.7);
  z-index: 1;
}
.hero .moon-big::after {
  /* faint crater texture using layered shadows */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 62% 58%, oklch(0.55 0.02 256 / 0.5) 0 7px, transparent 8px),
    radial-gradient(circle at 44% 72%, oklch(0.55 0.02 256 / 0.4) 0 11px, transparent 12px),
    radial-gradient(circle at 70% 38%, oklch(0.55 0.02 256 / 0.35) 0 5px, transparent 6px);
  mix-blend-mode: multiply;
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--silver); box-shadow: 0 0 10px var(--silver); }
.hero h1 {
  font-size: clamp(48px, 7.4vw, 104px);
  max-width: 16ch;
  margin-bottom: 30px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--silver), oklch(0.80 0.14 248), oklch(0.80 0.14 300));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p.lede { font-size: clamp(18px, 2vw, 22px); color: var(--ink-2); max-width: 56ch; margin-bottom: 40px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "Space Grotesk"; font-weight: 500; font-size: 16px;
  padding: 15px 26px; border-radius: 100px; transition: transform .2s var(--ease), box-shadow .3s, background .3s;
}
.btn-primary { background: var(--silver); color: var(--bg); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px oklch(0.86 0.03 256 / 0.28); }
.btn-ghost { color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--silver); background: var(--surface); }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* stat strip */
.stats { display: flex; flex-wrap: wrap; gap: 56px; margin-top: 88px; padding-top: 40px; border-top: 1px solid var(--line-soft); }
.stat .num { font-family: "Space Grotesk"; font-weight: 600; font-size: 40px; letter-spacing: -0.02em; }
.stat .lab { font-size: 14px; color: var(--ink-3); margin-top: 4px; }

/* ---------- SECTION SHELL ---------- */
section { position: relative; z-index: 2; }
.sec-head { max-width: 720px; margin-bottom: 56px; }
.sec-head .mono { display: block; margin-bottom: 18px; }
.sec-head h2 { font-size: clamp(34px, 4.6vw, 60px); }
.sec-head p { color: var(--ink-2); margin-top: 20px; font-size: 19px; }

/* ---------- WHAT WE DO ---------- */
.do { padding: 120px 0; }
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pillar {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-soft); border-radius: 24px; padding: 40px;
  position: relative; overflow: hidden;
}
.pillar .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 26px; border: 1px solid var(--line); }
.pillar h3 { font-size: 28px; margin-bottom: 14px; }
.pillar p { color: var(--ink-2); font-size: 17px; }
.pillar .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag { font-family: "Space Mono"; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding: 6px 12px; border: 1px solid var(--line); border-radius: 100px; }

/* ---------- PROJECTS ---------- */
.projects { padding: 40px 0 130px; }
.proj-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.proj {
  --accent: var(--silver);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 26px;
  overflow: hidden; transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.proj:hover { transform: translateY(-6px); border-color: color-mix(in oklch, var(--accent) 55%, var(--line)); box-shadow: 0 30px 70px oklch(0.10 0.02 256 / 0.6); }
.proj-body { padding: 44px; display: flex; flex-direction: column; }
.proj-top { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.proj-mark {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-family: "Space Grotesk"; font-weight: 700; font-size: 20px; color: var(--bg);
  background: var(--accent); box-shadow: 0 0 28px color-mix(in oklch, var(--accent) 45%, transparent);
}
.proj-name { font-family: "Space Grotesk"; font-weight: 600; font-size: 23px; }
.proj-kind { font-family: "Space Mono"; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.proj h3.pitch { font-size: clamp(26px, 2.6vw, 34px); margin-bottom: 16px; max-width: 18ch; }
.proj p.desc { color: var(--ink-2); font-size: 17px; margin-bottom: 28px; }
.proj-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.proj-link { display: inline-flex; align-items: center; gap: 9px; font-family: "Space Grotesk"; font-weight: 500; color: var(--ink); font-size: 16px; }
.proj-link .arrow { transition: transform .25s var(--ease); color: var(--accent); }
.proj:hover .proj-link .arrow { transform: translate(4px, -4px); }
.proj-url { font-family: "Space Mono"; font-size: 12px; color: var(--ink-3); }

/* visual side */
.proj-vis { position: relative; min-height: 280px; border-left: 1px solid var(--line-soft); overflow: hidden;
  background:
    radial-gradient(120% 100% at 100% 0%, color-mix(in oklch, var(--accent) 16%, transparent), transparent 60%),
    repeating-linear-gradient(135deg, oklch(0.24 0.02 256) 0 2px, transparent 2px 12px);
}
.proj-vis .ph-label { position: absolute; left: 18px; bottom: 16px; font-family: "Space Mono"; font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }
.proj-vis .orb {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, color-mix(in oklch, var(--accent) 85%, white), var(--accent) 60%, color-mix(in oklch, var(--accent) 30%, black));
  box-shadow: 0 0 60px color-mix(in oklch, var(--accent) 50%, transparent), inset -10px -10px 26px oklch(0.18 0.02 256 / 0.6);
  transition: transform .5s var(--ease);
}
.proj:hover .proj-vis .orb { transform: translate(-50%,-50%) scale(1.08); }

/* ---------- ETHOS ---------- */
.ethos { padding: 120px 0; border-top: 1px solid var(--line-soft); }
.ethos-grid { display: grid; grid-template-columns: 0.8fr 1fr; gap: 64px; align-items: start; }
.ethos blockquote { font-family: "Space Grotesk"; font-weight: 500; font-size: clamp(26px, 3.4vw, 42px); line-height: 1.18; letter-spacing: -0.02em; }
.ethos blockquote .muted { color: var(--ink-3); }
.ethos-list { display: flex; flex-direction: column; gap: 0; }
.ethos-item { padding: 26px 0; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: 56px 1fr; gap: 16px; }
.ethos-item:first-child { border-top: 1px solid var(--line-soft); }
.ethos-item .n { font-family: "Space Mono"; color: var(--ink-3); font-size: 14px; }
.ethos-item h4 { font-family: "Space Grotesk"; font-weight: 600; font-size: 20px; margin-bottom: 6px; }
.ethos-item p { color: var(--ink-2); font-size: 16px; }

/* ---------- CONTACT ---------- */
.contact { padding: 40px 0 130px; }
.contact-card {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--surface-2), var(--bg-2));
  border: 1px solid var(--line); border-radius: 32px; padding: 80px 64px; text-align: center;
}
.contact-card .glow { position: absolute; inset: 0; background: radial-gradient(50% 120% at 50% -20%, oklch(0.86 0.05 256 / 0.18), transparent 70%); pointer-events: none; }
.contact-card h2 { font-size: clamp(34px, 5vw, 64px); margin-bottom: 22px; }
.contact-card p { color: var(--ink-2); font-size: 20px; max-width: 52ch; margin: 0 auto 38px; }

/* ---------- FOOTER ---------- */
footer { border-top: 1px solid var(--line-soft); padding: 64px 0 48px; position: relative; z-index: 2; }
.foot-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-bottom: 56px; }
.foot-brand { max-width: 320px; }
.foot-brand .brand { margin-bottom: 18px; }
.foot-brand p { color: var(--ink-3); font-size: 15px; }
.foot-cols { display: flex; gap: 72px; flex-wrap: wrap; }
.foot-col h5 { font-family: "Space Mono"; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; }
.foot-col a { display: block; color: var(--ink-2); font-size: 15px; padding: 5px 0; transition: color .2s; }
.foot-col a:hover { color: var(--ink); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding-top: 28px; border-top: 1px solid var(--line-soft); }
.foot-bottom span { font-family: "Space Mono"; font-size: 12px; color: var(--ink-3); }

/* ---------- reveal ---------- */
.reveal { opacity: 1; transform: none; }
html.anim .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
html.anim .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.anim .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .pillars { grid-template-columns: 1fr; }
  .proj { grid-template-columns: 1fr; }
  .proj-vis { min-height: 200px; border-left: none; border-top: 1px solid var(--line-soft); order: -1; }
  .ethos-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero .moon-big { width: 300px; height: 300px; top: 90px; right: -90px; opacity: 0.75; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .wrap { padding: 0 22px; }
  .nav-links { display: none; }
  .menu-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
  .menu-btn span { width: 18px; height: 1.5px; background: var(--ink); display: block; position: relative; }
  .menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; width: 18px; height: 1.5px; background: var(--ink); }
  .menu-btn span::before { top: -6px; } .menu-btn span::after { top: 6px; }
  .hero { padding: 140px 0 90px; }
  .stats { gap: 36px; }
  .pillar, .proj-body, .contact-card { padding: 30px; }
  .contact-card { padding: 54px 26px; }
  .stat .num { font-size: 32px; }
}
