/* ============================================================
   Neuronplex styles.css
   Aesthetic: warm editorial edtech · "learning is wonder"
   Type: Newsreader (display) + Hanken Grotesk (body)
   ============================================================ */

:root {
  /* Surfaces */
  --paper:    #FCF6EC;   /* warm cream canvas */
  --paper-2:  #F6EAD9;   /* deeper cream for alternating sections */
  --card:     #FFFFFF;

  /* Ink / text */
  --ink:      #211A33;   /* headings + body */
  --ink-2:    #574F66;   /* secondary text */
  --ink-3:    #736C81;   /* muted / placeholders */

  /* Lines */
  --line:     #EADCC9;   /* warm hairline */

  /* Accents */
  --coral:      #FF6B4A;
  --coral-ink:  #E8482A; /* large text, borders, hover */
  --coral-text: #C2371A; /* small text / links on light */
  --teal:       #12B3A6;
  --teal-ink:   #0C857B; /* small text */
  --gold:       #F4B43E;

  /* Geometry */
  --radius:    20px;
  --radius-sm: 14px;
  --radius-lg: 28px;
  --maxw:      1140px;
  --pad:       clamp(20px, 5vw, 40px);

  /* Shadows (warm-tinted) */
  --shadow-sm: 0 2px 10px rgba(33,26,51,.06);
  --shadow:    0 16px 44px -20px rgba(33,26,51,.30);
  --shadow-lg: 0 32px 72px -28px rgba(33,26,51,.36);

  /* Type */
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body:    'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(16px, 1.04rem, 18px);
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: 1.06;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Fine grain texture over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: .045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip-link {
  position: absolute;
  left: 12px; top: -64px;
  z-index: 2000;
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: .85em 1.4em;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s;
}
.btn--sm { padding: .62em 1.05em; font-size: .94rem; border-radius: 11px; }
.btn--lg { padding: .95em 1.6em; font-size: 1.06rem; border-radius: 16px; }

.btn--primary {
  --btn-bg: var(--coral);
  --btn-fg: #2A0E06;
  box-shadow: 0 12px 26px -12px rgba(255,107,74,.75);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 32px -12px rgba(255,107,74,.8); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: rgba(33,26,51,.22);
}
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--ink); background: rgba(33,26,51,.045); }

.btn:active { transform: translateY(0); }
.btn__arrow { transition: transform .2s var(--ease); }
.btn--ghost:hover .btn__arrow { transform: translateX(4px); }

/* ---------- Brand / mark ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
}
.brand__word { font-size: 1.34rem; letter-spacing: -.02em; }
.brand__mark, .brand__mark-img, .mark { width: 30px; height: 30px; }
.mark { color: var(--ink); overflow: visible; }
.mark .node--gold { fill: var(--gold); }
.mark .node--teal { fill: var(--teal); }
.mark .node--coral { fill: var(--coral); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 72px;
}
.site-header--scrolled {
  background: rgba(252,246,236,.82);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 26px -18px rgba(33,26,51,.5);
}

.site-nav { display: flex; align-items: center; gap: 30px; }
.site-nav a:not(.btn) {
  font-weight: 500;
  color: var(--ink-2);
  position: relative;
  padding: 6px 1px;
  transition: color .2s;
}
.site-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--coral);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .26s var(--ease);
}
.site-nav a:not(.btn):hover { color: var(--ink); }
.site-nav a:not(.btn):hover::after { transform: scaleX(1); }

/* Hamburger */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle__bar {
  width: 24px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .28s var(--ease), opacity .2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: flex;
  flex-direction: column;
  padding: 6px var(--pad) 22px;
  background: rgba(252,246,236,.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a:not(.btn) {
  padding: 14px 2px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.mobile-menu .btn { margin-top: 16px; }

@media (max-width: 840px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Kicker ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--coral-text);
  margin: 0 0 22px;
}
.kicker__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(255,107,74,.16);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(124px, 17vh, 188px);
  padding-bottom: clamp(60px, 9vh, 110px);
  overflow: hidden;
}
.hero__glow {
  position: absolute;
  inset: -12% -10% auto -10%;
  height: 130%;
  z-index: -1;
  background:
    radial-gradient(38% 50% at 80% 18%, rgba(255,107,74,.22), transparent 70%),
    radial-gradient(42% 46% at 92% 62%, rgba(18,179,166,.16), transparent 70%),
    radial-gradient(32% 42% at 10% 8%, rgba(244,180,62,.20), transparent 72%);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
}
.hero__title {
  font-size: clamp(2.7rem, 7vw, 4.6rem);
  letter-spacing: -.03em;
  margin: 0 0 22px;
}
.accent-word {
  font-style: italic;
  color: var(--coral-ink);
  white-space: nowrap;
}
.accent-word__dot {
  display: inline-block;
  width: .15em; height: .15em;
  border-radius: 50%;
  background: var(--teal);
  margin-left: .03em;
  vertical-align: baseline;
}
.hero__lead {
  font-size: clamp(1.08rem, 1.5vw, 1.27rem);
  color: var(--ink-2);
  max-width: 36ch;
  margin: 0 0 32px;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}
.hero__meta {
  font-size: .9rem;
  color: var(--ink-2);
  font-weight: 500;
  letter-spacing: .01em;
}

.hero__visual { position: relative; }
.constellation {
  width: 100%;
  max-width: 480px;
  height: auto;
  margin-inline: auto;
  color: var(--ink);
  overflow: visible;
}
.constellation__links { opacity: .45; }
.constellation .node--hub  { fill: var(--gold); filter: drop-shadow(0 0 16px rgba(244,180,62,.55)); }
.constellation .node--ink  { fill: var(--ink); }
.constellation .node--teal { fill: var(--teal); }
.constellation .node--coral{ fill: var(--coral); }
.constellation .node { transform-box: fill-box; transform-origin: center; }

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding-block: clamp(64px, 10vw, 122px);
  scroll-margin-top: 84px;
}
.about   { background: var(--paper); }
.apps    { background: var(--paper-2); }
.contact { background: var(--paper); }

.section__head { max-width: 700px; margin-bottom: clamp(40px, 6vw, 64px); }
.section__title {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  margin: 14px 0 0;
}
.section__title em { font-style: italic; color: var(--coral-ink); }
.section__lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--ink-2);
  margin: 20px 0 0;
  max-width: 60ch;
}

/* ---------- Pillars ---------- */
.pillars {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.pillar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.pillar:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.pillar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px; height: 54px;
  border-radius: 16px;
  margin-bottom: 20px;
  color: var(--ink);
  background: var(--paper-2);
}
.pillar__icon .i { width: 28px; height: 28px; }
.pillar--teal  .pillar__icon { background: rgba(18,179,166,.12); }
.pillar--teal  .i-accent { fill: var(--teal); }
.pillar--coral .pillar__icon { background: rgba(255,107,74,.13); }
.pillar--coral .i-accent { fill: var(--coral); }
.pillar--gold  .pillar__icon { background: rgba(244,180,62,.18); }
.pillar--gold  .i-accent { fill: var(--gold); }
.pillar__title { font-family: var(--font-body); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; margin: 0 0 10px; }
.pillar__text  { color: var(--ink-2); }

/* ---------- Apps ---------- */
.apps .section__head { max-width: 720px; margin: 0 auto; text-align: center; }
.apps .section__lead { margin-inline: auto; }
.app-shelf {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(14px, 3.2vw, 28px);
  margin-top: clamp(30px, 5vw, 48px);
}
.app-tile {
  width: clamp(78px, 16vw, 120px);
  aspect-ratio: 1;
  border-radius: 26%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;            /* clip the glyph to the tile (iOS Safari safety net) */
  box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
/* height:auto + explicit svg width/height attrs avoids iOS Safari mis-sizing
   percentage-height SVGs inside an aspect-ratio box (renders them huge). */
.app-tile svg { width: 48%; height: auto; aspect-ratio: 1; }
.app-tile:hover { transform: translateY(-7px) rotate(-3deg); box-shadow: var(--shadow-lg); }
.app-tile--coral { background: var(--coral); color: #fff; }
.app-tile--teal  { background: var(--teal);  color: #fff; }
.app-tile--gold  { background: var(--gold);  color: var(--ink); }
.app-tile--ink   { background: var(--ink);   color: #FCF6EC; }
.apps__note {
  text-align: center;
  color: var(--ink-2);
  font-weight: 600;
  margin: clamp(24px, 4vw, 34px) 0 0;
}

/* ---------- Contact ---------- */
.contact__inner {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: clamp(30px, 6vw, 72px);
  align-items: start;
}
/* ---------- Form ---------- */
.form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow);
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: .92rem;
  margin-bottom: 8px;
  color: var(--ink);
}
.field input,
.field textarea,
.select-wrap select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 124px; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field input:focus,
.field textarea:focus,
.select-wrap select:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(255,107,74,.16);
  background: #fff;
}
.select-wrap { position: relative; }
.select-wrap__chevron {
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ink-2);
  font-size: .7rem;
}
/* Honeypot: visually hidden, off-screen */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}
.form__submit { width: 100%; margin-top: 8px; }
.form--sending .form__submit { opacity: .72; pointer-events: none; }
.form__status { margin: 16px 0 0; font-weight: 600; font-size: .96rem; min-height: 1.2em; }
.form__status--success { color: var(--teal-ink); }
.form__status--error   { color: var(--coral-text); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #EFE9F2;
  padding-block: clamp(48px, 7vw, 72px) 28px;
}
.site-footer .brand, .site-footer .brand__word { color: #fff; }
.site-footer .mark { color: #fff; }
.site-footer .mark .node--ink { fill: #fff; }
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.site-footer__tag {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: #C9C2D6;
  margin: 14px 0 0;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
}
.site-footer__links a { color: #C9C2D6; font-weight: 500; transition: color .2s; }
.site-footer__links a:hover { color: #fff; }
.site-footer__base {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
  font-size: .88rem;
  color: #9890A8;
}

/* ============================================================
   Motion
   ============================================================ */
@keyframes fade-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* Hero load reveal (CSS only, no JS dependency) */
.hero__content > * { animation: fade-up .8s var(--ease) backwards; }
.hero .kicker     { animation-delay: .05s; }
.hero__title      { animation-delay: .16s; }
.hero__lead       { animation-delay: .30s; }
.hero__actions    { animation-delay: .42s; }
.hero__meta       { animation-delay: .54s; }
.hero__visual     { animation: fade-up 1s var(--ease) .35s backwards; }

.constellation { animation: float-y 9s var(--ease) infinite; }
.constellation__nodes .node { animation: twinkle 4s ease-in-out infinite; }
.constellation__nodes .node:nth-child(2) { animation-delay: .3s; }
.constellation__nodes .node:nth-child(3) { animation-delay: .9s; }
.constellation__nodes .node:nth-child(4) { animation-delay: 1.5s; }
.constellation__nodes .node:nth-child(5) { animation-delay: .6s; }
.constellation__nodes .node:nth-child(6) { animation-delay: 2.1s; }
.constellation__nodes .node:nth-child(7) { animation-delay: 1.2s; }
.constellation__nodes .node:nth-child(8) { animation-delay: 2.5s; }
.constellation__nodes .node:nth-child(9) { animation-delay: 1.8s; }

/* Scroll reveal (only active when JS is present) */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
html.js [data-reveal].in-view { opacity: 1; transform: none; }
html.js .pillar[data-reveal]:nth-child(2) { transition-delay: .1s; }
html.js .pillar[data-reveal]:nth-child(3) { transition-delay: .2s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; gap: 18px; }
  .hero__visual { max-width: 340px; margin-top: 14px; }
  .contact__inner { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .pillars { grid-template-columns: 1fr; gap: 18px; max-width: 540px; }
}

@media (max-width: 520px) {
  .hero__visual { max-width: 280px; }
  .site-footer__inner { flex-direction: column; gap: 18px; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  html.js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .constellation { animation: none !important; }
}
