:root {
  --iya-green: #1f6a3b;
  --shader-lime: #c7ff2e;
  --shader-sky: #49c7ff;
  --shader-coral: #ff6f59;
  --paper: #f7f3ec;
  --paper-wash: #eef3ea;
  --paper-shadow: rgba(17, 17, 17, 0.08);
  --ink: #101010;
  --ink-soft: rgba(16, 16, 16, 0.66);
  --ink-muted: rgba(16, 16, 16, 0.44);
  --line: rgba(16, 16, 16, 0.09);
  --white-soft: rgba(255, 255, 255, 0.78);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(circle at 18% 9%, rgba(31, 106, 59, 0.12), transparent 270px),
    radial-gradient(circle at 80% 72%, rgba(31, 106, 59, 0.06), transparent 360px),
    var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Mono", "Space Mono", "SFMono-Regular", "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 120px 120px;
  content: "";
  mask-image: radial-gradient(circle at center, black, transparent 84%);
  opacity: 0.3;
  animation: ambientShift 18s ease-in-out infinite alternate;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.page-shell {
  position: relative;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

.hero-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100svh;
  min-height: 100dvh;
  padding: clamp(4.8rem, 12vh, 7rem) clamp(1.25rem, 5vw, 6rem) clamp(6rem, 13vh, 8rem);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.hero-section::before {
  position: absolute;
  inset: -18% -12% -8%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(199, 255, 46, 0.66), transparent 29%),
    radial-gradient(circle at 81% 18%, rgba(73, 199, 255, 0.42), transparent 31%),
    radial-gradient(circle at 57% 76%, rgba(255, 111, 89, 0.36), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(238, 243, 234, 0.78));
  content: "";
  filter: blur(1px) saturate(1.16);
}

.hero-section::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(247, 243, 236, 0.06), rgba(247, 243, 236, 0.42) 74%, var(--paper)),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.34), transparent 52%);
  content: "";
}

.hero-shader {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 900ms ease;
}

.hero-section.is-shader-ready .hero-shader {
  opacity: 1;
}

.hero {
  position: relative;
  z-index: 1;
  width: min(100%, 84rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand {
  display: inline-grid;
  place-items: center;
  width: clamp(3.15rem, 6vw, 4.9rem);
  height: clamp(3.15rem, 6vw, 4.9rem);
  color: var(--iya-green);
  text-decoration: none;
}

.brand-mark {
  width: clamp(2.65rem, 4.8vw, 4.35rem);
  height: clamp(2.65rem, 4.8vw, 4.35rem);
  color: var(--iya-green);
  transform-origin: center;
  animation: logoDrift 6.5s ease-in-out infinite;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 48rem;
  padding-top: clamp(1.8rem, 4vh, 2.5rem);
  font-family: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(3.5rem, 7.2vw, 6.45rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-weight: 400;
  text-wrap: balance;
}

.hero-copy {
  width: min(100%, 34rem);
  padding-top: clamp(1.05rem, 2.5vh, 1.45rem);
  color: var(--ink-soft);
  font-size: clamp(0.82rem, 1.25vw, 0.94rem);
  line-height: 1.72;
}

.hero-actions {
  padding-top: clamp(2.25rem, 5vh, 3.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}

.button {
  min-height: 3.12rem;
  padding: 0 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.81rem;
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease,
    background-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  filter: saturate(1.05);
}

.button:active {
  transform: translateY(0) scale(0.985);
}

.button-dark {
  background: var(--ink);
  box-shadow: 0 22px 48px -36px rgba(16, 16, 16, 0.55);
}

.button-green {
  background: var(--iya-green);
  box-shadow: 0 20px 42px -34px rgba(31, 106, 59, 0.62);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 720ms ease,
    transform 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

.page-shell.is-ready [data-reveal] {
  opacity: 1;
  transform: translateY(0);
}

.page-shell.is-ready [data-reveal="section"] {
  transition-delay: 160ms;
}

.why-section {
  padding: clamp(5.8rem, 13vw, 7.3rem) clamp(1.5rem, 7vw, 6rem) clamp(4.8rem, 10vw, 5.6rem);
  border-bottom: 1px solid var(--line);
}

.section-copy {
  width: min(100%, 38.75rem);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.section-index {
  color: var(--ink-muted);
  font-size: 0.68rem;
  line-height: 1;
}

.section-copy h2,
.approach h2 {
  font-family: "IBM Plex Mono", "Space Mono", "SFMono-Regular", "SF Mono", monospace;
  font-size: clamp(1.35rem, 2.1vw, 1.72rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.section-body {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.7;
}

.agent-section {
  min-height: 26rem;
  padding: clamp(4rem, 10vw, 5rem) clamp(1.25rem, 6.7vw, 6rem) clamp(5.2rem, 11vw, 6.5rem);
  display: grid;
  grid-template-columns: minmax(15rem, 22rem) minmax(21rem, 24.5rem) minmax(15rem, 22rem);
  align-items: start;
  justify-content: space-between;
  gap: clamp(2rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
}

.approach {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.approach-label {
  color: var(--ink-muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.approach-iya .approach-label {
  color: var(--iya-green);
}

.approach p:not(.approach-label) {
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.62;
}

.tag-row {
  padding-top: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.tag-row span {
  min-height: 1.15rem;
  padding: 0.08rem 0.55rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(16, 16, 16, 0.14);
  border-radius: 0.25rem;
  color: rgba(16, 16, 16, 0.55);
  font-size: 0.62rem;
}

.approach-iya .tag-row span {
  border-color: rgba(31, 106, 59, 0.24);
  color: var(--iya-green);
}

.agent-flow {
  position: relative;
  min-height: 12rem;
  display: grid;
  grid-template-columns: 8.8rem 1.2rem 6.75rem 1.2rem 7rem;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.input-stack,
.output-stack {
  display: flex;
  flex-direction: column;
  gap: 0.44rem;
}

.input-stack span,
.output-stack span {
  min-height: 1.5rem;
  display: inline-flex;
  align-items: center;
  border-radius: 0.35rem;
  font-size: 0.62rem;
  line-height: 1;
  white-space: nowrap;
}

.input-stack span {
  padding-left: 0.65rem;
  border: 1px solid rgba(16, 16, 16, 0.12);
  background: rgba(255, 255, 255, 0.5);
  color: rgba(16, 16, 16, 0.56);
}

.input-stack span:last-child {
  border-color: rgba(31, 106, 59, 0.22);
  background: rgba(31, 106, 59, 0.06);
  color: var(--iya-green);
}

.output-stack span {
  justify-content: center;
  padding: 0 0.65rem;
  background: var(--ink);
  color: #ffffff;
}

.output-stack span:nth-child(even) {
  background: var(--iya-green);
}

.flow-line {
  height: 1px;
  background: rgba(16, 16, 16, 0.18);
}

.agent-node {
  width: 6.75rem;
  height: 6.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border: 1px solid rgba(31, 106, 59, 0.24);
  border-radius: 999px;
  background: var(--white-soft);
  box-shadow: 0 24px 55px -44px rgba(16, 16, 16, 0.38);
}

.agent-mark {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--iya-green);
}

.agent-node span {
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.site-dialog {
  width: min(calc(100% - 2rem), 34rem);
  padding: 0;
  border: 0;
  border-radius: 1rem;
  background: transparent;
  color: var(--ink);
}

.site-dialog::backdrop {
  background: rgba(16, 16, 16, 0.24);
  backdrop-filter: blur(5px);
}

.dialog-panel {
  position: relative;
  width: 100%;
  padding: clamp(1.5rem, 5vw, 2.2rem);
  display: flex;
  flex-direction: column;
  gap: 0.78rem;
  border: 1px solid rgba(16, 16, 16, 0.09);
  border-radius: 1rem;
  background: rgba(247, 243, 236, 0.96);
  box-shadow: 0 28px 70px -42px rgba(16, 16, 16, 0.45);
}

.dialog-panel h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 400;
}

.dialog-panel p {
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.6;
}

.dialog-kicker {
  color: var(--iya-green) !important;
  font-size: 0.68rem !important;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dialog-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(16, 16, 16, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 0.68rem;
}

.dialog-panel label {
  padding-top: 0.28rem;
  color: rgba(16, 16, 16, 0.72);
  font-size: 0.72rem;
}

.dialog-panel input,
.dialog-panel textarea {
  width: 100%;
  border: 1px solid rgba(16, 16, 16, 0.12);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  outline: none;
  font-size: 0.84rem;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.dialog-panel input {
  min-height: 3rem;
  padding: 0 0.9rem;
}

.dialog-panel textarea {
  min-height: 7rem;
  padding: 0.8rem 0.9rem;
  resize: vertical;
}

.dialog-panel input:focus,
.dialog-panel textarea:focus {
  border-color: rgba(31, 106, 59, 0.42);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(31, 106, 59, 0.08);
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.58rem;
}

.dialog-panel .button {
  min-height: 3rem;
}

.dialog-panel .button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.form-status,
.contact-status {
  min-height: 1.3rem;
  color: var(--ink-soft);
  font-size: 0.72rem !important;
  line-height: 1.45 !important;
}

.form-status[data-state="success"],
.contact-status[data-state="success"] {
  color: var(--iya-green);
}

.form-status[data-state="loading"] {
  color: rgba(16, 16, 16, 0.56);
}

.form-status[data-state="error"],
.contact-status[data-state="error"] {
  color: #8e2d21;
}

.waitlist-form.is-success {
  animation: successPulse 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes logoDrift {
  0% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-3px) scale(1.018);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes ambientShift {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0.26;
  }

  100% {
    transform: translate3d(0, -10px, 0);
    opacity: 0.36;
  }
}

@keyframes successPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 24px 55px -34px rgba(31, 106, 59, 0.18);
  }

  45% {
    transform: scale(1.012);
    box-shadow: 0 28px 62px -30px rgba(31, 106, 59, 0.36);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 24px 55px -34px rgba(31, 106, 59, 0.14);
  }
}

@media (max-width: 980px) {
  .agent-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .agent-flow {
    justify-self: center;
    width: min(100%, 24.5rem);
  }
}

@media (max-width: 720px) {
  .hero-section {
    min-height: 100dvh;
    padding:
      max(3.8rem, env(safe-area-inset-top))
      clamp(1.15rem, 6vw, 1.5rem)
      max(4rem, env(safe-area-inset-bottom));
  }

  h1 {
    max-width: min(100%, 10.5ch);
    font-size: clamp(3rem, 15vw, 4.6rem);
    letter-spacing: -0.05em;
  }

  .hero-copy {
    width: min(100%, 22rem);
    font-size: 0.82rem;
    line-height: 1.58;
  }

  .hero-actions {
    width: min(100%, 21rem);
    flex-direction: column;
    padding-top: 2rem;
  }

  .button,
  .hero-actions .button {
    width: 100%;
  }

  .why-section {
    padding: 4.6rem 1.3rem 4rem;
  }

  .section-copy {
    width: 100%;
  }

  .agent-section {
    padding: 3.8rem 1.3rem 4.6rem;
    gap: 2.5rem;
  }

  .agent-flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
  }

  .input-stack,
  .output-stack {
    width: min(100%, 15rem);
    justify-self: center;
  }

  .flow-line {
    width: 1px;
    height: 1rem;
    justify-self: center;
  }

  .agent-node {
    justify-self: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body::before,
  .hero-shader,
  .brand-mark,
  [data-reveal],
  .waitlist-form.is-success {
    animation: none;
    transition-duration: 0.01ms;
    transition-delay: 0ms;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
