/* tria landing page.
   Layout: tria's own. Theme: white, black, deep green glow with grain,
   Geist + Geist Mono, square mono buttons, thin lines. */

:root {
  --bg: #ffffff;
  --tint: #f6f9f7;       /* soft panel */
  --ink: #0f0f0f;
  --body: #4a4a4a;
  --muted: #7a7a7a;
  --line: #e8e8ec;
  --accent: #0f7a5a;     /* deep green: the one pop color. Use sparingly */
  --accent-soft: #e2f3eb;
  --on-accent: #ffffff;
  --error: #c4291c;
  --sans: "Geist", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a { color: inherit; }
p { margin: 0; }

/* Small mono caps: the "label" voice of the theme */
.nav nav a:not(.btn),
.btn,
.link,
.eyebrow,
.step-num,
label,
.footer-inner p:last-child {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Nav (translucent layer, content scrolls under) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
.nav nav { display: flex; align-items: center; gap: 2rem; }
.nav nav a:not(.btn) {
  text-decoration: none;
  font-size: 0.8125rem;
  color: #333;
  transition: color 150ms ease;
}
.nav nav a:not(.btn):hover { color: var(--accent); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: -0.035em;
}
.brand-mark { width: 1.5rem; height: 1.25rem; }
.brand-small { font-size: 1.125rem; }
.brand-small .brand-mark { width: 1.2rem; height: 1rem; }

/* ---------- Buttons: square, mono, instant press feedback ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  padding: 0 1.5rem;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: transform 100ms ease-out, background-color 150ms ease, border-color 150ms ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover { background: var(--ink); border-color: var(--ink); }
.btn:active { transform: scale(0.98); transition-duration: 50ms; }
.btn-small { height: 2.4rem; padding: 0 1rem; font-size: 0.8125rem; }
.btn-full { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: default; }

.link {
  font-size: 0.875rem;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
}
.link:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Type ---------- */
h1, h2, h3 { margin: 0; font-weight: 400; }

h1 {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 20ch;
}
h3 {
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.lead {
  font-size: clamp(1.125rem, 2vw, 1.3125rem);
  line-height: 1.55;
  color: #3b3b3b;
  max-width: 34ch;
}
.body-lg {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--body);
  max-width: 38ch;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8125rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.eyebrow::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  background: var(--accent);
}

/* ---------- Hero: deep green glow with fine grain ---------- */
.hero-band {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #f2f8f5, #f8fbfa);
}
.blob {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(70px);
  will-change: transform;
}
.b1 { width: 42vw; height: 42vw; top: -18vw; right: -12vw; opacity: 0.42; animation: drift1 24s ease-in-out infinite alternate; }
.b2 { width: 34vw; height: 34vw; bottom: -22vw; right: 18vw; opacity: 0.26; animation: drift2 30s ease-in-out infinite alternate; }
.b3 { width: 30vw; height: 30vw; bottom: -18vw; left: -12vw; opacity: 0.2; animation: drift3 27s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-9vw, 7vw) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-14vw, -5vw) scale(0.9); } }
@keyframes drift3 { to { transform: translate(8vw, -6vw) scale(1.15); } }

/* Soft light that follows the mouse (moved by main.js) */
.spot {
  position: absolute;
  top: 0;
  left: 0;
  width: 26rem;
  height: 26rem;
  margin: -13rem 0 0 -13rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(15, 122, 90, 0.22), transparent);
  opacity: 0;
  transition: opacity 400ms ease;
  pointer-events: none;
}
.hero-band.has-spot .spot { opacity: 1; }
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.hero {
  padding-top: clamp(5rem, 14vh, 9rem);
  padding-bottom: clamp(6rem, 16vh, 10rem);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.hero-mark {
  width: 4.5rem;
  height: 3.75rem;
  color: var(--accent);
  overflow: visible;
  cursor: pointer;
  transform-origin: 50% 61%;   /* where the three strokes meet */
  transition: transform 1100ms cubic-bezier(0.34, 1.3, 0.5, 1);
}
.hero-mark .s {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 650ms var(--ease) forwards;
}
.hero-mark .s1 { animation-delay: 100ms; }
.hero-mark .s2 { animation-delay: 260ms; }
.hero-mark .s3 { animation-delay: 420ms; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* One highlighted phrase in the headline */
.hl {
  /* Gradient text (deep green to fresh green) with a soft blue glow behind it */
  background: linear-gradient(100deg, #0a5a42 0%, #0f7a5a 25%, #2fb383 50%, #0f7a5a 75%, #0a5a42 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  padding-right: 0.04em;
  filter: drop-shadow(0 0.06em 0.22em rgba(15, 122, 90, 0.35));
  animation:
    hl-in 900ms var(--ease) 500ms both,
    hl-flow 9s linear 1.4s infinite;
}
@keyframes hl-in {
  from { opacity: 0; filter: blur(8px) drop-shadow(0 0.06em 0.22em rgba(15, 122, 90, 0)); }
  to { opacity: 1; filter: blur(0) drop-shadow(0 0.06em 0.22em rgba(15, 122, 90, 0.35)); }
}
/* The colors slowly slide across the words, then loop seamlessly */
@keyframes hl-flow {
  from { background-position: 0% 0; }
  to { background-position: -200% 0; }
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* ---------- Sections ---------- */
.section {
  padding-top: clamp(4.5rem, 10vh, 7rem);
  padding-bottom: clamp(4.5rem, 10vh, 7rem);
  border-top: 1px solid var(--line);
}
.hero-band + .section { border-top: 0; }

.cards {
  list-style: none;
  margin: 3.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 35%, var(--tint));
  padding: 2rem 1.75rem 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 13rem;
  justify-content: flex-end;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.card:hover { border-color: #bfe0d2; box-shadow: 0 16px 40px -24px rgba(15, 122, 90, 0.45); }
.card p { color: var(--body); }
.card h3 { margin-top: auto; }

/* Small live drawings inside the cards */
.art {
  height: 6.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-end;
}
.art-bars { gap: 0.45rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--line); }
.art-bars i {
  width: 1.1rem;
  height: calc(var(--h) * 100%);
  background: linear-gradient(180deg, var(--accent), #7fc8ab);
  transform-origin: bottom;
  transition: transform 700ms var(--ease);
}
.art-bars i:nth-child(1) { transition-delay: 0ms; }
.art-bars i:nth-child(2) { transition-delay: 60ms; }
.art-bars i:nth-child(3) { transition-delay: 120ms; }
.art-bars i:nth-child(4) { transition-delay: 180ms; }
.art-bars i:nth-child(5) { transition-delay: 240ms; }
.art-bars i:nth-child(6) { transition-delay: 300ms; }
.card:hover .art-bars i:nth-child(odd) { transform: scaleY(0.7); }
.card:hover .art-bars i:nth-child(even) { transform: scaleY(1.08); }

.art-phone { align-items: flex-start; }
.phone {
  width: 5.2rem;
  height: 6.5rem;
  border: 1.5px solid var(--ink);
  border-radius: 0.9rem;
  padding: 0.9rem 0.55rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: #fff;
  transition: transform 500ms var(--ease);
}
.card:hover .phone { transform: translateY(-4px) rotate(-3deg); }
.row { height: 0.85rem; background: #eef0f6; border-radius: 3px; }
.row-ok {
  position: relative;
  background: var(--accent-soft);
  transition: background-color 400ms ease 500ms;
}
.row-ok b {
  position: absolute;
  right: -0.55rem;
  top: 50%;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: -0.675rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px -2px rgba(15, 122, 90, 0.5);
  transition: transform 500ms cubic-bezier(0.34, 1.5, 0.5, 1) 700ms;
}
.row-ok svg { width: 0.85rem; height: 0.85rem; }

.art-flow { align-items: center; gap: 0; }
.node {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  border: 1.5px solid var(--ink);
  background: #fff;
}
.node-end { background: var(--accent); border-color: var(--accent); }
.wire {
  position: relative;
  flex: 1;
  height: 1.5px;
  background: var(--line);
  overflow: visible;
}
.pulse {
  position: absolute;
  top: -3px;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 2px rgba(15, 122, 90, 0.45);
  animation: travel 2.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.pulse.later { animation-delay: 1.2s; }
@keyframes travel {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: calc(100% - 0.5rem); opacity: 0; }
}
.card:hover .pulse { animation-duration: 1.2s; }
.card:hover .pulse.later { animation-delay: 0.6s; }

/* Before a card row scrolls into view, drawings start "empty" */
.js .cards.reveal:not(.in) .art-bars i { transform: scaleY(0); }
.js .cards.reveal:not(.in) .row-ok { background: #eef0f6; }
.js .cards.reveal:not(.in) .row-ok b { transform: scale(0); }

.steps {
  list-style: none;
  margin: 3.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}
.steps { position: relative; }
.steps::before,
.steps::after {
  content: "";
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  width: calc(2 * ((100% - 5rem) / 3 + 2.5rem));
  height: 1.5px;
  background: var(--line);
}
.steps::after {
  background: var(--accent);
  transform-origin: left;
  transition: transform 1400ms var(--ease) 200ms;
}
.steps li { position: relative; display: flex; flex-direction: column; gap: 1.25rem; }
.steps .step-num { position: relative; z-index: 1; transition: transform 500ms cubic-bezier(0.34, 1.5, 0.5, 1), opacity 300ms ease; }
.steps li:nth-child(2) .step-num { transition-delay: 700ms; }
.steps li:nth-child(3) .step-num { transition-delay: 1400ms; }
.js .steps.reveal:not(.in)::after { transform: scaleX(0); }
.js .steps.reveal:not(.in) .step-num { transform: scale(0.3); opacity: 0; }
.steps p { color: var(--body); margin-top: 0.5rem; max-width: 30ch; }
.step-num {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  letter-spacing: 0;
}

.why { display: flex; flex-direction: column; gap: 1.5rem; }
.why .eyebrow { margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 4rem;
  align-items: start;
}
.contact-intro { display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 6rem; }
.contact-intro .eyebrow { margin-bottom: 0; }

.form,
.success {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -36px rgba(15, 122, 90, 0.35);
  padding: 2rem;
}
.form { display: flex; flex-direction: column; gap: 1.25rem; }
.form[hidden],
.success[hidden] { display: none; }

.field { display: flex; flex-direction: column; gap: 0.5rem; }
label { font-size: 0.75rem; color: #444; }

input, textarea {
  font: inherit;
  font-size: 1rem;           /* 16px+ stops iOS zoom on focus */
  color: var(--ink);
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.85rem 1rem;
  width: 100%;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
textarea { resize: vertical; min-height: 8rem; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #9e9e9e; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field.invalid input,
.field.invalid textarea { border-color: var(--error); }

.error { display: none; color: var(--error); font-size: 0.875rem; }
.field.invalid .error { display: block; }

.form-note { font-size: 0.8125rem; color: var(--muted); text-align: center; }

.hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.success {
  text-align: center;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.success p { color: var(--body); }
.success-mark { width: 3rem; height: 2.5rem; margin-bottom: 0.75rem; color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.875rem;
}
.footer-inner p:last-child { font-size: 0.75rem; }
.footer .brand { color: var(--ink); }

/* ---------- Gentle entrance (only when JS is on) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; }

.success.in-anim { animation: pop 500ms var(--ease) both; }
@keyframes pop {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* Screenshot mode (?still): show everything in its finished state */
.still .hl, .still .hero-mark .s, .still .blob { animation: none !important; }
.still .hero-mark .s { stroke-dashoffset: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .cards, .steps { grid-template-columns: 1fr; }
  .steps::before, .steps::after { display: none; }
  .card { min-height: 0; }
  .contact { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-intro { position: static; }
}
@media (max-width: 560px) {
  .nav nav a:not(.btn) { display: none; }
  h1 br { display: none; }
  h1 { line-height: 1.1; }
  .form { padding: 1.5rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Accessibility preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob, .pulse, .hl, .hero-mark .s { animation: none !important; }
  .hero-mark .s { stroke-dashoffset: 0; }
  .pulse { left: 45%; }
  .spot { display: none; }
  .hero-mark { transition: none; }
  .js .reveal { transform: none; transition: opacity 300ms ease; }
  .success.in-anim { animation: none; }
  .btn:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --muted: #3d3c38; --body: #222; --line: #8a8984; }
}
