/* General Admission */
:root {
  --bg: #FFFFFF;
  --bg-dots: #E4E4E4;
  --fg: #0A0A0A;
  --ink: #0A0A0A;
  --ink-soft: #3A3A3A;
  --pill: #0A0A0A;
  --pill-text: #FFFFFF;
}

* { box-sizing: border-box; }

html, body, #root {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", "Inter", system-ui, -apple-system, sans-serif;
  overflow: hidden;
}
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.ga-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}

/* Overlay layer */
.ga-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.ga-overlay > * { pointer-events: auto; }

.ga-corner {
  position: fixed;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 900ms cubic-bezier(.2,.7,.2,1), transform 900ms cubic-bezier(.2,.7,.2,1);
  color: var(--ink);
}
.ga-overlay.is-revealed .ga-corner-tl { opacity: 1; transform: none; transition-delay: 200ms; }
.ga-overlay.is-revealed .ga-corner-tr { opacity: 1; transform: none; transition-delay: 450ms; }
.ga-overlay.is-revealed .ga-corner-bl { opacity: 1; transform: none; transition-delay: 700ms; }
.ga-overlay.is-revealed .ga-corner-br { opacity: 1; transform: none; transition-delay: 950ms; }

/* Harmonized margins — top and bottom corners share the same inset */
.ga-corner-tl { top: 24px;    left: 64px;  max-width: 460px; }
.ga-corner-tr {
  top: 16px; right: 64px;
  display: flex; align-items: center; gap: 12px;
}

/* Theme toggle — circular icon button to the left of CONTACT */
.ga-theme-toggle {
  appearance: none;
  width: 36px; height: 36px; border-radius: 999px;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease, border-color 200ms ease;
}
.ga-theme-toggle:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border-color: color-mix(in srgb, var(--ink) 35%, transparent);
}
.ga-theme-toggle:active { transform: scale(0.96); }
.ga-corner-bl { bottom: 48px; left: 64px;  max-width: 480px; }
.ga-corner-br { bottom: 48px; right: 64px; }

.ga-intro { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.ga-intro strong { font-weight: 700; letter-spacing: 0.04em; }
.ga-footer-copy { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink); text-wrap: pretty; }

/* Project stats — quiet caption pair, matches body type */
.ga-stats {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: row; gap: 28px; align-items: baseline; justify-content: flex-end;
  font-size: 14.5px; line-height: 1.55;
  color: var(--ink);
}
.ga-stats li {
  display: inline-flex; align-items: baseline; gap: 14px;
  white-space: nowrap;
}
.ga-stats span { color: var(--ink); font-weight: 400; }
.ga-stats b {
  font-weight: 500;
  color: var(--ink);
  font-feature-settings: "tnum" 1;
  min-width: 1.6em; text-align: right;
}

/* CONTACT pill — stroke outline (line weight matches the theme toggle) */
.ga-pill {
  appearance: none;
  background: transparent;
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  font: inherit; font-size: 13px; font-weight: 500; letter-spacing: 0.18em;
  padding: 10px 22px; border-radius: 999px; cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.ga-pill:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border-color: color-mix(in srgb, var(--ink) 35%, transparent);
}
.ga-pill:active { transform: scale(0.98); }
/* Pill content swap — text on desktop, email icon on mobile */
.ga-pill-icon { display: none; align-items: center; justify-content: center; }
.ga-pill-text { display: inline; }

/* ===== Contact reveal — form materializes on top of a cleared region of the dotfield =====
   The cleared region itself is painted by the DotField canvas (excludeRect API).
   This layer holds the click-catcher backdrop, the corner ticks, and the form content. */
.ga-contact-stage {
  position: fixed; inset: 0; z-index: 50;
  background: transparent;
  pointer-events: auto;
}
/* Scrim removed \u2014 form sits cleanly on the dotfield with no background dim. */

.ga-contact-frame {
  position: absolute;
  background: var(--bg);
  border-radius: 18px;
  box-shadow:
    0 30px 80px -20px rgba(0,0,0,0.35),
    0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent);
  opacity: 0;
  transform: scale(0.985);
  transition:
    opacity 500ms ease 220ms,
    transform 700ms cubic-bezier(.2,.7,.2,1) 200ms,
    top 480ms cubic-bezier(.4,.1,.2,1),
    height 480ms cubic-bezier(.4,.1,.2,1);
  display: flex; flex-direction: column;
}
.ga-contact-stage.is-open .ga-contact-frame { opacity: 1; transform: none; }
.ga-contact-stage.is-closing .ga-contact-frame {
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 220ms ease, transform 280ms ease;
}

/* Body content inside the frame — no card chrome */
.ga-contact-body {
  position: relative;
  flex: 1; min-height: 0;
  padding: 144px 48px 32px;
  overflow: auto;
  display: flex; flex-direction: column;
}
.ga-panel-close {
  position: absolute; top: 18px; right: 18px;
  width: 36px; height: 36px; border-radius: 999px;
  background: transparent; border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 200ms ease, transform 200ms ease;
  z-index: 2;
}
.ga-panel-close:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); transform: rotate(90deg); }

.ga-panel-title {
  font-weight: 400; font-size: clamp(30px, 3.6vw, 40px);
  font-style: normal;
  margin: -75px 0 22px; color: var(--ink); letter-spacing: -0.015em; line-height: 1.1;
}
.ga-panel-sub {
  margin: 0 0 26px; font-size: 14px; line-height: 1.5;
  color: var(--ink-soft); opacity: 0.7; max-width: 38ch;
}

/* ===== Underline form fields — no boxes, animated rule ===== */
.ga-form { display: grid; gap: 14px; }

.ga-uf {
  display: grid; gap: 8px;
  position: relative;
}
.ga-uf-label {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-soft); opacity: 0.7;
  display: flex; align-items: baseline; gap: 8px;
  transition: color 200ms ease, opacity 200ms ease;
}
.ga-uf-label em {
  font-style: normal; text-transform: none; letter-spacing: 0.02em;
  font-size: 10px; opacity: 0.55;
}
.ga-uf.is-focused .ga-uf-label { color: var(--ink); opacity: 1; }
.ga-uf.is-error .ga-uf-rule-base { background: color-mix(in srgb, #B0341A 50%, transparent); }
.ga-uf.is-error .ga-uf-rule-fill { background: #B0341A; transform: scaleX(1); }
.ga-uf-err { color: #B0341A; font-style: normal; opacity: 0.85; letter-spacing: 0.02em; text-transform: none; }

.ga-uf-input {
  font: inherit; font-size: 17px; color: var(--ink);
  background: transparent; border: 0; outline: none;
  padding: 6px 0;
  font-family: inherit;
  resize: vertical;
  width: 100%;
}
textarea.ga-uf-input { min-height: 40px; line-height: 1.5; resize: none; }

.ga-uf-rule {
  position: relative;
  display: block;
  height: 1px;
  width: 100%;
  margin-top: 2px;
}
.ga-uf-rule-base, .ga-uf-rule-fill {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
}
.ga-uf-rule-base { background: color-mix(in srgb, var(--ink) 16%, transparent); }
.ga-uf-rule-fill {
  background: var(--ink);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 450ms cubic-bezier(.2,.7,.2,1);
}
.ga-uf.is-focused .ga-uf-rule-fill,
.ga-uf.is-filled .ga-uf-rule-fill { transform: scaleX(1); }

/* ===== Action row + send button ===== */
.ga-form-actions {
  display: flex; gap: 12px; justify-content: flex-end;
  margin-top: 6px; align-items: center;
}
.ga-btn {
  appearance: none; font: inherit; font-size: 13px; font-weight: 500;
  letter-spacing: 0.04em; padding: 11px 22px; border-radius: 999px; cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, opacity 180ms ease;
  border: 1px solid transparent;
}
.ga-btn:disabled { opacity: 0.6; cursor: default; }
.ga-btn-ghost { background: transparent; border-color: color-mix(in srgb, var(--ink) 20%, transparent); color: var(--ink); }
.ga-btn-ghost:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.ga-btn-solid { background: var(--pill); color: var(--pill-text); border-color: var(--pill); }
.ga-btn-solid:hover:not(:disabled) { transform: translateY(-1px); }

/* Send button — label + transmitting dots */
.ga-btn-send {
  position: relative;
  display: inline-flex; align-items: center; gap: 12px;
  min-width: 180px; justify-content: center;
}
.ga-btn-dots {
  display: inline-flex; gap: 4px;
  align-items: center;
}
.ga-btn-dots i {
  width: 4px; height: 4px; border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
  transform: translateY(0);
  transition: opacity 200ms ease;
}
.ga-btn-send:not(.is-sending) .ga-btn-dots i:nth-child(4),
.ga-btn-send:not(.is-sending) .ga-btn-dots i:nth-child(5) { display: none; }
.ga-btn-send.is-sending .ga-btn-dots i {
  animation: ga-tx 1.1s cubic-bezier(.4,0,.2,1) infinite;
}
.ga-btn-send.is-sending .ga-btn-dots i:nth-child(1) { animation-delay: 0ms; }
.ga-btn-send.is-sending .ga-btn-dots i:nth-child(2) { animation-delay: 110ms; }
.ga-btn-send.is-sending .ga-btn-dots i:nth-child(3) { animation-delay: 220ms; }
.ga-btn-send.is-sending .ga-btn-dots i:nth-child(4) { animation-delay: 330ms; }
.ga-btn-send.is-sending .ga-btn-dots i:nth-child(5) { animation-delay: 440ms; }
@keyframes ga-tx {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  35%      { opacity: 1;    transform: translateY(-3px); }
  70%      { opacity: 0.4;  transform: translateY(0); }
}

.ga-form-error {
  font-size: 13px; line-height: 1.55;
  color: #B0341A;
  background: color-mix(in srgb, #B0341A 8%, transparent);
  border: 1px solid color-mix(in srgb, #B0341A 25%, transparent);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: -8px;
}
.ga-form-error a { color: inherit; text-decoration: underline; }

/* Sent state — minimal, centered, no card chrome */
.ga-contact-sent {
  align-items: center; justify-content: center;
  text-align: center;
  padding: 32px 28px;
  gap: 14px;
  overflow: hidden;
}
.ga-sent-title {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 400;
  color: var(--ink);
  animation: ga-sent-in 480ms cubic-bezier(.2,.7,.2,1) both;
}
.ga-sent-meta {
  margin: 0;
  font-size: 14.5px;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  animation: ga-sent-in 480ms cubic-bezier(.2,.7,.2,1) 120ms both;
}
@keyframes ga-sent-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Sent state — no card */
.ga-contact-sent .ga-panel-sub { margin: 0 auto 28px; }
.ga-dotmark {
  display: inline-flex; gap: 10px; margin: 0 auto 28px;
  align-items: center; justify-content: center;
  height: 24px;
}
.ga-dotmark i {
  width: 14px; height: 14px; border-radius: 999px;
  background: var(--ink);
  opacity: 0;
  animation: ga-dotmark 900ms cubic-bezier(.2,.7,.2,1) forwards;
}
.ga-dotmark i:nth-child(1) { animation-delay: 0ms; }
.ga-dotmark i:nth-child(2) { animation-delay: 140ms; }
.ga-dotmark i:nth-child(3) { animation-delay: 280ms; }
@keyframes ga-dotmark {
  from { opacity: 0; transform: scale(0.4) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
  /* Top row: GA blurb left (62%) + theme toggle / email icon right.
     BL footer stays bottom-left. BR stats hidden to avoid overlap. */
  .ga-corner-tl {
    top: 16px; left: 20px;
    width: calc(62% - 20px); max-width: calc(62% - 20px);
  }
  .ga-corner-tr {
    top: 16px; right: 20px;
    width: auto; justify-content: flex-end;
    gap: 10px;
  }
  .ga-corner-bl { left: 20px; bottom: 24px; max-width: calc(100% - 40px); }
  .ga-corner-br { display: none; }

  .ga-intro,
  .ga-footer-copy { font-size: 13px; line-height: 1.45; }

  /* Email-icon-only on mobile — match theme toggle dimensions */
  .ga-pill {
    width: 44px; height: 44px; padding: 0;
    border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .ga-pill-text { display: none; }
  .ga-pill-icon { display: inline-flex; }
  .ga-pill-icon svg { width: 22px; height: 22px; }
  .ga-theme-toggle { width: 44px; height: 44px; }
  .ga-theme-toggle svg { width: 20px; height: 20px; }

  .ga-panel-contact { padding: 44px 28px 32px; }
  .ga-contact-body { padding: 88px 28px 28px; }
}

/* Very narrow — extra fitting tweaks */
@media (max-width: 380px) {
  .ga-intro, .ga-footer-copy { font-size: 12.5px; }
}

/* ===========================================================================
   Theme crossfade — when [data-cascading] is set on <html>, UI text/borders
   ease through the inversion in step with the canvas fade.
   =========================================================================== */
html[data-cascading] .ga-corner-tl,
html[data-cascading] .ga-corner-tl *,
html[data-cascading] .ga-corner-tr,
html[data-cascading] .ga-corner-tr *,
html[data-cascading] .ga-corner-bl,
html[data-cascading] .ga-corner-bl *,
html[data-cascading] .ga-corner-br,
html[data-cascading] .ga-corner-br *,
html[data-cascading] .ga-stats,
html[data-cascading] .ga-stats *,
html[data-cascading] .ga-contact-frame,
html[data-cascading] .ga-contact-frame *,
html[data-cascading] .ga-panel-close,
html[data-cascading] .ga-panel-title,
html[data-cascading] .ga-panel-sub,
html[data-cascading] .ga-uf-label,
html[data-cascading] .ga-uf-input,
html[data-cascading] .ga-uf-rule-base,
html[data-cascading] .ga-uf-rule-fill,
html[data-cascading] .ga-btn,
html[data-cascading] .ga-dotmark i {
  transition:
    color 110ms ease,
    background-color 110ms ease,
    border-color 110ms ease,
    fill 110ms ease !important;
}
