/* ============================================================
   ANAGRON — landing page (design "2a", extended)
   ============================================================ */

:root {
  --bg:         #08090b;
  --fg:         #efeee9;
  --fg-muted:   rgba(239, 238, 233, 0.65);
  --fg-body:    rgba(239, 238, 233, 0.82);
  --wordmark:   rgba(239, 238, 233, 0.9);

  --emerald-1:  #0e8f60;
  --emerald-2:  #2fd39a;
  --emerald-3:  #a8e8cf;

  --btn-dark:   #0e1013;

  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Custom cursor — the Anagron mark
   ============================================================ */
html,
body {
  cursor: url("cursor-anagron.png") 14 7, auto;
}
a,
.btn,
.scroll-hint,
[data-open-contact],
.modal-close {
  cursor: url("cursor-anagron.png") 14 7, pointer;
}

/* ============================================================
   Custom scrollbar — thin glowing emerald
   ============================================================ */
html {
  scrollbar-width: thin;                              /* Firefox */
  scrollbar-color: var(--emerald-2) transparent;      /* Firefox */
}
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--emerald-2);
  border-radius: 20px;
  border: 3px solid transparent;        /* transparent padding → thinner bar */
  background-clip: padding-box;
  box-shadow: 0 0 8px rgba(47, 211, 154, 0.75);
}
::-webkit-scrollbar-thumb:hover {
  background: #52e6b0;
  background-clip: padding-box;
  box-shadow: 0 0 12px rgba(47, 211, 154, 0.9);
}

/* ---- Particle canvas: fixed behind everything ---- */
#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ============================================================
   Buttons (white, per the design)
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: #fff;
  color: var(--btn-dark);
  font-family: var(--font);
  font-weight: 600;
  font-size: 17px;
  padding: 16px 36px;
  border-radius: 4px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover {
  background: #e8f7f0;
  transform: translateY(-1px);
}
.btn-sm {
  font-size: 14px;
  padding: 10px 22px;
}

/* ============================================================
   Landing screen (hero)
   ============================================================ */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* soft central vignette so centered text reads over the field */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 78% 60% at 50% 48%, rgba(8, 9, 11, 0.5), rgba(8, 9, 11, 0) 76%);
}
.hero-header,
.hero-body,
.scroll-hint {
  position: relative;
  z-index: 1;
}

.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space, 16px);
  padding: 26px clamp(24px, 5vw, 44px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand img { width: 31px; height: 31px; border-radius: 7px; }
.wordmark {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.5em;
  color: var(--wordmark);
}

/* Headline block — dead center */
.hero-body {
  flex: 1;                       /* fill space between header and bottom */
  display: flex;
  flex-direction: column;
  justify-content: center;       /* center vertically */
  align-items: center;           /* center horizontally */
  text-align: center;
  gap: clamp(20px, 3vh, 34px);
  max-width: 900px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 44px) clamp(40px, 8vh, 80px);
}
.hero-body h1 {
  font-family: 'Kanit', var(--font);
  font-size: clamp(2.8rem, 8.6vw, 82px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0.02em;
  font-variant-ligatures: none;   /* keep f and i separate */
  text-shadow: 0 2px 24px rgba(8, 9, 11, 0.45);
}
/* Quick one-time glow on the headline (fired when the subtext finishes typing) */
@keyframes headlineGlow {
  0%   { text-shadow: 0 2px 24px rgba(8, 9, 11, 0.45); }
  35%  { text-shadow: 0 2px 24px rgba(8, 9, 11, 0.45), 0 0 34px rgba(155, 242, 208, 0.5), 0 0 82px rgba(47, 211, 154, 0.36); }
  60%  { text-shadow: 0 2px 24px rgba(8, 9, 11, 0.45), 0 0 34px rgba(155, 242, 208, 0.42), 0 0 82px rgba(47, 211, 154, 0.3); }
  100% { text-shadow: 0 2px 24px rgba(8, 9, 11, 0.45); }
}
.hero-body h1.glow-pulse,
.hero-body h1.glow-pulse .grad {
  animation: headlineGlow 1.8s ease-in-out;
}

.hero-body .grad {
  background: linear-gradient(100deg, var(--emerald-1), var(--emerald-2) 60%, var(--emerald-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-body .sub {
  font-size: clamp(0.85rem, 1.7vw, 19px);
  font-weight: 400;
  line-height: 1.6;
  min-height: 1.6em;             /* reserve one line so nothing jumps while typing */
  color: rgba(239, 238, 233, 0.88);
  text-shadow: 0 1px 18px rgba(8, 9, 11, 0.95), 0 0 4px rgba(8, 9, 11, 0.8);
  max-width: none;
  white-space: nowrap;           /* keep it on a single line */
}
.sub-line {
  display: block;
}
/* allow it to wrap on phones so it doesn't overflow the screen */
@media (max-width: 640px) {
  .hero-body .sub { white-space: normal; }
}
.type-caret {
  color: var(--emerald-2);
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Scroll cue — pinned to the bottom of the hero */
.scroll-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(24px, 4vh, 40px);
  display: block;
  text-align: center;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg-muted);
  animation: floaty 2.2s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(5px); opacity: 1; }
}

/* ============================================================
   Below the fold — solid background covers the particles
   ============================================================ */

/* extra scroll of starfield before the paragraph */
.hero-gap {
  height: 38vh;
}

.below {
  position: relative;
  z-index: 1;
  /* semi-transparent so the starfield faintly continues behind the text */
  background: rgba(8, 9, 11, 0.86);
}
/* On phones, make it opaque so scrolling doesn't repaint the animated
   canvas behind a translucent layer (fixes scroll lag). */
@media (max-width: 700px), (hover: none) {
  .below {
    background: var(--bg);
  }
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 44px);
}

.prose {
  padding: clamp(64px, 12vh, 140px) 0 clamp(32px, 6vh, 56px);
}
.prose p {
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  font-weight: 400;
  line-height: 1.75;
  color: var(--fg-body);
  text-shadow: 0 1px 14px rgba(8, 9, 11, 0.85);
}
.prose p + p {
  margin-top: clamp(20px, 3vh, 28px);
}

/* Larger opening line */
.prose .lead {
  font-size: clamp(1.3rem, 2.5vw, 1.85rem);
  font-weight: 500;
  line-height: 1.5;
  color: #efeee9;
  margin-bottom: clamp(28px, 4vh, 44px);
}

/* Emerald emphasis on key concept words */
.hl { color: var(--emerald-2); }

/* Scroll reveal for the paragraphs + closing CTA */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.prose p:nth-of-type(2) { transition-delay: 0.08s; }
.prose p:nth-of-type(3) { transition-delay: 0.16s; }
.prose p:nth-of-type(4) { transition-delay: 0.24s; }

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

/* ============================================================
   Contact form
   ============================================================ */
.contact-section {
  padding: clamp(48px, 8vh, 90px) 0 clamp(72px, 14vh, 140px);
  border-top: 1px solid rgba(236, 237, 234, 0.08);
}
.contact-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.contact-sub {
  color: var(--fg-muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.6;
  max-width: 560px;
  margin-top: 12px;
}
.contact-link {
  color: var(--emerald-2);
  text-decoration: none;
}
.contact-link:hover { text-decoration: underline; }

.contact-form {
  max-width: 560px;
  margin-top: clamp(28px, 4vh, 44px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-size: 0.9rem;
  color: var(--fg-muted);
}
.field input,
.field textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(236, 237, 234, 0.14);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field textarea {
  resize: vertical;
  min-height: 120px;
}
.field input::placeholder,
.field textarea::placeholder {
  color: rgba(236, 237, 234, 0.35);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--emerald-2);
  box-shadow: 0 0 0 3px rgba(47, 211, 154, 0.15);
  background: rgba(255, 255, 255, 0.06);
}
#contactSubmit {
  align-self: flex-start;
}
#contactSubmit[disabled] {
  opacity: 0.6;
  cursor: default;
}
.hidden-honeypot {
  display: none !important;
}
.form-status {
  font-size: 0.95rem;
  min-height: 1.2em;
  margin-top: 2px;
}
.form-status.success { color: var(--emerald-2); }
.form-status.error { color: #ff6b6b; }

/* Bottom "Get in touch" button section */
.closing {
  padding: clamp(56px, 10vh, 120px) 0 clamp(80px, 15vh, 150px);
  border-top: 1px solid rgba(236, 237, 234, 0.08);
}
.closing-inner {
  display: flex;
  justify-content: center;
}
.btn-lg {
  padding: 17px 42px;
  font-size: 18px;
}

/* ============================================================
   Contact modal (popup)
   ============================================================ */
body.modal-open {
  overflow: hidden;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.modal.open {
  opacity: 1;
  visibility: visible;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 7, 0.72);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0f1216;
  border: 1px solid rgba(236, 237, 234, 0.12);
  border-radius: 16px;
  padding: clamp(26px, 4vw, 42px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s ease;
}
.modal.open .modal-card {
  transform: none;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--fg-muted);
  font-size: 26px;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.modal-close:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
}
.modal-title {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding-right: 32px;
}
.modal-sub {
  color: var(--fg-muted);
  font-size: 0.98rem;
  line-height: 1.55;
  margin-top: 8px;
}
.modal .contact-form {
  margin-top: 26px;
}

@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal-card {
    transition: none;
  }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-hint { animation: none; }
  .btn { transition: none; }
}
