/* Noctix Interactive — noctix.games */

:root {
  --bg: #08090b;
  --bg-raised: #0e1013;
  --ink: #f4f1eb;
  --ink-soft: #c5c3bf;
  --ink-mute: #8f8c87;
  --line: rgba(244, 241, 235, .14);
  --line-strong: rgba(244, 241, 235, .32);
  --accent: #d9b991;
  --accent-deep: #bba17d;
  --danger: #e59a8c;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: fixed; top: 12px; left: 12px; z-index: 50;
  padding: 10px 16px; background: var(--ink); color: var(--bg);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  transform: translateY(-200%); transition: transform .2s;
}
.skip:focus { transform: none; }

/* ---------- Atmosphere ---------- */

#world {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

.progress {
  position: fixed; top: 0; left: 0; z-index: 20;
  height: 2px; width: 0; background: var(--accent);
}

/* ---------- Header ---------- */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px var(--gutter);
  background: linear-gradient(rgba(8, 9, 11, .85), rgba(8, 9, 11, 0));
  transition: background .35s, padding .35s;
}
.site-header.scrolled {
  background: rgba(8, 9, 11, .78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 22px; height: auto; }
.brand span {
  font-family: var(--serif); font-weight: 500;
  font-size: 17px; letter-spacing: .28em; line-height: 1;
}
.brand small {
  display: block; margin-top: 5px;
  font-family: var(--sans); font-size: 7.5px; font-weight: 400; letter-spacing: .5em;
  color: var(--ink-soft);
}

.site-header nav { display: flex; align-items: center; gap: 28px; }
.site-header nav a {
  font-size: 11px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft); transition: color .25s;
}
.site-header nav a:hover { color: var(--accent); }
.site-header .nav-cta {
  color: var(--ink); padding: 9px 16px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  transition: border-color .25s, color .25s;
}
.site-header .nav-cta:hover { border-color: var(--accent); }

/* ---------- Chapter rail ---------- */

.chapters {
  position: fixed; right: var(--gutter); top: 50%; z-index: 9;
  transform: translateY(-50%);
  display: grid; gap: 16px;
}
.chapters a {
  display: block; width: 8px; height: 8px;
  border: 1px solid var(--ink-mute); border-radius: 50%;
  transition: background .3s, transform .3s, border-color .3s;
}
.chapters a.active { background: var(--accent); border-color: var(--accent); transform: scale(1.4); }

.counter {
  position: fixed; bottom: 28px; left: var(--gutter); z-index: 9;
  font-size: 10px; letter-spacing: .22em; color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

/* ---------- Scenes ---------- */

main { position: relative; z-index: 1; }

.scene { position: relative; height: 145svh; }

.frame {
  position: sticky; top: 0; height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 90px 10vw; text-align: center; overflow: hidden;
}

.copy { position: relative; max-width: 860px; will-change: transform, opacity; }

.kicker {
  margin-bottom: 24px;
  font-size: 10px; font-weight: 400; letter-spacing: .38em; text-transform: uppercase;
  color: var(--accent);
}

h2 {
  margin: 0;
  font: 300 clamp(60px, 10.5vw, 156px)/.92 var(--serif);
  letter-spacing: -.035em;
}

.scene p {
  max-width: 500px; margin: 26px auto 0;
  font-size: clamp(15px, 1.7vw, 19px); line-height: 1.65; color: var(--ink-soft);
}

.hero .logo { display: block; width: min(340px, 64vw); margin: 0 auto; }
.hero .tagline {
  margin-top: 18px;
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(19px, 2.2vw, 26px); letter-spacing: .02em; color: var(--ink-soft);
}

.enter {
  display: inline-block; margin-top: 34px; padding: 12px 6px;
  font-size: 10px; font-weight: 400; letter-spacing: .3em; text-transform: uppercase;
  border-bottom: 1px solid var(--accent-deep);
  transition: color .25s, letter-spacing .4s;
}
.enter:hover { color: var(--accent); letter-spacing: .36em; }

/* ---------- Pillars ---------- */

.pillars {
  position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 64px);
  max-width: 1160px; margin: -10svh auto 0; padding: 0 var(--gutter) 22svh;
}

.pillar {
  padding-top: 26px; border-top: 1px solid var(--line-strong);
  opacity: 0; transform: translateY(24px);
  transition: opacity .9s ease, transform .9s ease;
}
.pillar.in { opacity: 1; transform: none; }
.pillar:nth-child(2) { transition-delay: .12s; }
.pillar:nth-child(3) { transition-delay: .24s; }

.pillar-num {
  font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--accent);
}
.pillar h3 {
  margin: 14px 0 12px;
  font: 400 clamp(26px, 2.6vw, 34px)/1.1 var(--serif); letter-spacing: -.01em;
}
.pillar p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--ink-soft); }

/* ---------- Contact ---------- */

.contact {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 130px var(--gutter) 0;
}

.contact-inner {
  width: 100%; max-width: 1160px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(40px, 7vw, 110px);
  align-items: start;
}

.contact h2 { font-size: clamp(52px, 7.4vw, 108px); }

.contact-intro > p {
  max-width: 420px; margin: 26px 0 0;
  font-size: 16px; line-height: 1.7; color: var(--ink-soft);
}

.contact-details { margin: 40px 0 0; display: grid; gap: 22px; }
.contact-details div { display: grid; gap: 6px; }
.contact-details dt {
  font-size: 10px; font-weight: 400; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-mute);
}
.contact-details dd { margin: 0; font-family: var(--serif); font-size: 24px; }
.contact-details dd a { border-bottom: 1px solid var(--line-strong); transition: border-color .25s, color .25s; }
.contact-details dd a:hover { color: var(--accent); border-color: var(--accent); }
.contact-details .socials-row[hidden] { display: none; }

.socials { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.socials a { font-size: 20px; }

/* Form */

.contact-form {
  position: relative;
  padding: clamp(24px, 3.5vw, 44px);
  background: rgba(14, 16, 19, .72);
  border: 1px solid var(--line);
  border-radius: 2px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.field { display: grid; gap: 8px; margin-bottom: 26px; }

.field label {
  font-size: 10px; font-weight: 400; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-mute);
  transition: color .25s;
}
.field:focus-within label { color: var(--accent); }

.field input,
.field select,
.field textarea {
  width: 100%; padding: 10px 0 12px;
  background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
  font-size: 16px; font-weight: 300; color: var(--ink);
  transition: border-color .25s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 10px) 52%, calc(100% - 5px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.field select option { background: var(--bg-raised); color: var(--ink); }

.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-bottom-color: var(--accent); }

.field.invalid input,
.field.invalid textarea { border-bottom-color: var(--danger); }
.field.invalid label { color: var(--danger); }

.form-foot { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 8px; }

.submit {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 15px 26px; cursor: pointer;
  background: var(--ink); color: var(--bg);
  border: 1px solid var(--ink); border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
  transition: background .25s, color .25s, border-color .25s;
}
.submit:hover { background: var(--accent); border-color: var(--accent); }
.submit-arrow { font-size: 15px; letter-spacing: 0; transition: transform .25s; }
.submit:hover .submit-arrow { transform: translateX(4px); }
.submit[disabled] { cursor: progress; opacity: .6; }

.form-status { flex: 1 1 200px; margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.form-status.error { color: var(--danger); }
.form-status.error a { border-bottom: 1px solid currentColor; }

.contact-form.sent .field,
.contact-form.sent .field-row,
.contact-form.sent .submit { display: none; }
.contact-form.sent .form-status {
  font-family: var(--serif); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.3; color: var(--ink);
}
.contact-form.sent .form-status small {
  display: block; margin-top: 10px;
  font-family: var(--sans); font-size: 14px; color: var(--ink-soft);
}

/* Footer */

.site-footer {
  width: 100%; max-width: 1160px; margin: 0 auto; padding: 90px 0 30px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-mute);
}
.site-footer a:hover { color: var(--accent); }

/* ---------- Standalone pages (thanks / 404) ---------- */

.standalone {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px var(--gutter); text-align: center;
  background: radial-gradient(circle at 50% 45%, #25231f 0%, var(--bg) 62%);
}
.standalone img { width: 64px; margin-bottom: 36px; }
.standalone h1 { margin: 0; font: 300 clamp(52px, 9vw, 120px)/.95 var(--serif); letter-spacing: -.03em; }
.standalone p { max-width: 440px; margin: 24px auto 0; font-size: 16px; line-height: 1.7; color: var(--ink-soft); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .contact-inner { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; gap: 40px; max-width: 560px; margin-top: -6svh; }
  .chapters, .counter { display: none; }
}

@media (max-width: 600px) {
  .site-header { padding: 18px 20px; }
  .site-header nav { gap: 14px; }
  .site-header nav a { font-size: 10px; letter-spacing: .1em; }
  .site-header .nav-cta { padding: 7px 12px; }
  .brand img { width: 18px; }
  .brand span { font-size: 14px; }
  .frame { padding: 80px 20px; }
  .scene { height: 125svh; }
  .contact { padding: 110px 20px 0; }
  .field-row { grid-template-columns: 1fr; }
  .contact-details dd { font-size: 21px; }
  .site-footer { flex-direction: column; align-items: flex-start; padding-top: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scene { height: 100svh; }
  .copy { transform: none !important; opacity: 1 !important; }
  .pillar { opacity: 1; transform: none; transition: none; }
}
