/* Light page; the dark portrait is the one dark block. Accents from the portrait. */
:root {
  --paper: #f4f6f7;     /* page bg, cool light grey */
  --white: #ffffff;
  --ink: #0b1620;       /* text + portrait frame */
  --line: #d9dfe3;
  --skin: #b8683f;      /* human accent */
  --cyan: #0a8f99;      /* machine accent, dark enough to read on light */
  --steel: #56656e;     /* muted text */

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --wrap: 1120px;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--cyan); color: var(--white); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem max(1.5rem, calc((100% - var(--wrap)) / 2 + 1.5rem));
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand { font: 600 1.5rem/1 var(--serif); text-decoration: none; }
.brand-dot { color: var(--cyan); }
.nav nav { display: flex; gap: 1.75rem; align-items: center; font-size: .95rem; }
.nav nav a { text-decoration: none; color: var(--steel); }
.nav nav a:hover { color: var(--ink); }
.nav nav a.nav-cta { color: var(--white); background: var(--ink); padding: .5rem 1rem; border-radius: 999px; font-weight: 500; }
.nav nav a.nav-cta:hover { background: var(--cyan); }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--wrap); margin: 0 auto; padding: 3.5rem 1.5rem 5rem;
  display: grid; grid-template-columns: 1fr minmax(280px, 520px) 1fr;
  align-items: center; gap: 2rem;
}
.hero-side { max-width: 20rem; }
.hero-side.human { justify-self: end; text-align: right; }
.hero-side.machine { justify-self: start; }
.hero-line { margin: 0 0 1rem; font: 400 clamp(1.9rem, 3.4vw, 2.9rem)/1.1 var(--serif); letter-spacing: -.01em; }
.human .hero-line { font-style: italic; }
.human .hero-line::after { content: ""; display: block; width: 3rem; height: 2px; background: var(--skin); margin: 1.1rem 0 0 auto; }
.hero-line.mono { font: 500 clamp(1.35rem, 2.3vw, 1.9rem)/1.3 var(--mono); color: var(--cyan); }
.prompt { opacity: .55; }
.hero-sub { margin: 0; color: var(--steel); font-size: .98rem; }

.portrait { position: relative; margin: 0; }
.portrait { background: var(--ink); border-radius: 22px; overflow: hidden; }
.portrait img { width: 100%; }
.seam {
  position: absolute; left: 50%; top: 0; width: 2px; height: 100%;
  transform: translateX(-50%) scaleY(0); transform-origin: top;
  background: #56e3e8;
  animation: seam 1.1s .25s cubic-bezier(.6,0,.2,1) forwards;
}
@keyframes seam { to { transform: translateX(-50%) scaleY(1); } }
#typed.typing::after { content: "▍"; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-actions { grid-column: 1 / -1; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: .85rem 1.5rem; border-radius: 999px;
  font: 500 1rem/1 var(--sans); text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--cyan); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--white); }

/* ---------- Sections ---------- */
.section { max-width: var(--wrap); margin: 0 auto; padding: 5rem 1.5rem; border-top: 1px solid var(--line); }
.h2 { font: 400 clamp(2rem, 4vw, 3rem)/1.1 var(--serif); margin: 0 0 .75rem; letter-spacing: -.015em; }
.lead { color: var(--steel); margin: 0 0 2.5rem; max-width: 36rem; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: grid; grid-template-columns: 17rem 1fr auto; gap: 2rem; align-items: baseline;
  padding: 1.5rem 0; border-bottom: 1px solid var(--line);
}
.rows h3 { margin: 0; font: 600 1.15rem/1.3 var(--sans); }
.rows p { margin: 0; color: var(--steel); max-width: 34rem; }
.tag { font: 400 .85rem var(--mono); color: var(--cyan); white-space: nowrap; }

.proof { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center; margin-bottom: 3rem; }
.big-num { margin: 0; font: 400 clamp(5rem, 12vw, 9rem)/.85 var(--serif); color: var(--skin); }
.proof-text { margin: 0; font: 400 clamp(1.15rem, 2vw, 1.45rem)/1.4 var(--serif); max-width: 30rem; }

.work { list-style: none; margin: 0; padding: 0; }
.work li {
  display: grid; grid-template-columns: 7rem 1fr auto; gap: 1.5rem; align-items: baseline;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.work-kind { color: var(--steel); font-size: .9rem; }
.work-name { font-weight: 500; }
.work-stack { font: 400 .85rem var(--mono); color: var(--cyan); }

.steps { list-style: none; counter-reset: s; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s); display: block; font: 400 2.5rem/1 var(--serif); color: var(--skin); margin-bottom: .75rem; }
.steps h3 { margin: 0 0 .4rem; font: 600 1.05rem var(--sans); }
.steps p { margin: 0; color: var(--steel); font-size: .98rem; }

/* ---------- Contact (dark band) ---------- */
.contact-wrap {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--ink); color: #e6edf1;
}
.contact-wrap::before { /* soft glows taken from the portrait */
  content: ""; position: absolute; inset: -20%; z-index: -1;
  background:
    radial-gradient(40% 50% at 85% 20%, rgba(86,227,232,.22), transparent 70%),
    radial-gradient(35% 45% at 10% 90%, rgba(184,104,63,.25), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
.contact-wrap::after { /* faint grid */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
@keyframes drift { to { transform: translate(-4%, 3%) scale(1.05); } }

.contact {
  max-width: var(--wrap); margin: 0 auto; padding: 6rem 1.5rem;
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 4rem; align-items: center;
}
.contact .h2 { color: var(--white); }
.contact .lead { color: #9fb0ba; margin-bottom: 2rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 1.25rem;
  font: 500 .8rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #56e3e8;
  border: 1px solid rgba(86,227,232,.3); border-radius: 999px; padding: .35rem .85rem;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61,220,132,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }

.perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.perks li { display: grid; gap: .1rem; padding-left: 1.4rem; position: relative; }
.perks li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 2px; background: var(--skin); transform: rotate(45deg); }
.perks b { color: var(--white); font-weight: 600; }
.perks span { color: #9fb0ba; font-size: .95rem; }

/* Card */
.form-card {
  position: relative; background: var(--white); color: var(--ink);
  border-radius: 24px; padding: 2rem;
  box-shadow: 0 0 0 1px rgba(86,227,232,.35), 0 40px 120px -40px rgba(86,227,232,.55);
}
.form-card::before { /* moving gradient rim */
  content: ""; position: absolute; inset: -2px; z-index: -1; border-radius: 26px;
  background: conic-gradient(from var(--a, 0deg), #56e3e8, transparent 30%, var(--skin) 55%, transparent 80%, #56e3e8);
  animation: spin 8s linear infinite; filter: blur(6px); opacity: .7;
}
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --a: 360deg; } }

.ctabs { display: flex; gap: .25rem; background: var(--paper); border-radius: 999px; padding: .3rem; margin-bottom: 1.5rem; width: fit-content; }
.ctab { font: 500 .92rem var(--sans); border: 0; background: none; color: var(--steel); padding: .55rem 1.1rem; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.ctab.is-active { background: var(--ink); color: var(--white); }
.ctab[hidden], .ctabs[hidden] { display: none; }
.pane { display: none; }
.pane.is-active { display: grid; animation: in-up .35s ease; }
.form[hidden], .sent[hidden] { display: none !important; }

.form { gap: 1.1rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.field { display: grid; gap: .4rem; }
.field > label { font-size: .9rem; color: var(--steel); font-weight: 500; }
.form input:not([type=radio]), .form textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1.5px solid transparent; border-radius: 12px; padding: .8rem .95rem; width: 100%;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.form textarea { resize: vertical; min-height: 7.5rem; }
.form input:focus, .form textarea:focus { outline: none; background: var(--white); border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(10,143,153,.12); }
.field.has-err input, .field.has-err textarea { border-color: var(--skin); background: #fdf5f0; }
.field-err { min-height: 0; font-size: .85rem; color: #a2532c; }
.field-err:empty { display: none; }
.field-err .fix { font: inherit; font-weight: 600; color: var(--cyan); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: .5rem .95rem; border-radius: 999px; font-size: .9rem; cursor: pointer;
  border: 1.5px solid var(--line); color: var(--steel); transition: all .15s;
}
.chip span:hover { border-color: var(--ink); color: var(--ink); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--white); }
.chip input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }

.btn-send {
  position: relative; overflow: hidden; display: flex; justify-content: center; align-items: center; gap: .6rem;
  width: 100%; padding: 1.05rem 1.5rem; font-weight: 600; background: var(--ink); color: var(--white);
}
.btn-send::after { /* shine sweep */
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.25), transparent); transform: skewX(-20deg);
}
.btn-send:hover { background: var(--cyan); }
.btn-send:hover::after { animation: shine .8s ease; }
.btn-send .arrow { transition: transform .2s; }
.btn-send:hover .arrow { transform: translateX(4px); }
.btn-send:disabled { opacity: .75; cursor: wait; }
.btn-send.is-busy .arrow { animation: blink 1s steps(1) infinite; }
@keyframes shine { to { left: 120%; } }
.hp { position: absolute; left: -9999px; }
.form-status { margin: 0; font-size: .92rem; }
.form-status:empty { display: none; }
.form-status.err { color: #a2532c; }
.form-status a { color: var(--cyan); font-weight: 600; }

/* Booking */
.book-pane { min-height: 520px; }
#cal-embed { width: 100%; min-height: 520px; overflow: auto; border-radius: 12px; }
.cal-loading { color: var(--steel); text-align: center; padding-top: 4rem; }

/* Success */
.sent { text-align: center; padding: 2.5rem 1rem 1.5rem; animation: in-up .4s ease; }
.sent h3 { font: 400 2rem/1.2 var(--serif); margin: 1rem 0 .4rem; }
.sent p { color: var(--steel); margin: 0 0 1.5rem; }
.tick { width: 72px; height: 72px; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tick circle { stroke: #3ddc84; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw .6s ease forwards; }
.tick path { stroke: var(--ink); stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .5s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.btn-ghost-light { border: 1px solid var(--line); background: none; color: var(--ink); }
.btn-ghost-light:hover { border-color: var(--ink); }

.footer {
  max-width: var(--wrap); margin: 0 auto; padding: 2rem 1.5rem 3rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--steel); font-size: .9rem; border-top: 1px solid var(--line);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 1rem; }
  .portrait { order: -1; max-width: 360px; margin: 0 auto; }
  .hero-side, .hero-side.human, .hero-side.machine { justify-self: center; text-align: center; max-width: 30rem; }
  .human .hero-line::after { margin: 1rem auto 0; }
  .rows li { grid-template-columns: 1fr; gap: .4rem; }
  .steps { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 1fr; gap: 2.5rem; padding: 4.5rem 1.5rem; }
}
@media (max-width: 560px) {
  .nav nav a:not(.nav-cta) { display: none; }
  .proof { grid-template-columns: 1fr; gap: 1rem; }
  .work li { grid-template-columns: 1fr; gap: .2rem; }
  .steps { grid-template-columns: 1fr; }
  .form-card { padding: 1rem 1.1rem 1.4rem; }
  .row2 { grid-template-columns: 1fr; }
  .ctabs { width: 100%; }
  .ctab { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .seam { animation: none; transform: translateX(-50%) scaleY(1); }
  .contact-wrap::before, .form-card::before, .pulse, .tick circle, .tick path { animation: none; }
  .tick circle, .tick path { stroke-dashoffset: 0; }
}

/* ---------- Motion ---------- */
/* Hero entrance: human side from the left, machine side from the right */
.js .hero-side, .js .portrait, .js .hero-actions { opacity: 0; }
.js .loaded .human { animation: in-left .9s .1s cubic-bezier(.2,.7,.2,1) forwards; }
.js .loaded .portrait { animation: in-fade .6s ease forwards; }
.js .loaded .portrait img { animation: zoom-out 1.6s cubic-bezier(.2,.7,.2,1); }
.js .loaded .machine { animation: in-right .9s .5s cubic-bezier(.2,.7,.2,1) forwards; }
.js .loaded .hero-actions { animation: in-up .7s 1.1s ease forwards; }
@keyframes in-left { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes in-right { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes in-fade { to { opacity: 1; } }
@keyframes zoom-out { from { transform: scale(1.18); } }
@keyframes in-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Portrait tilts toward the cursor */
.portrait { transition: transform .25s ease-out, box-shadow .25s; will-change: transform; }
.portrait.tilting { box-shadow: 0 40px 80px -30px rgba(11,22,32,.5); }

/* Scroll reveal */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

.rows li { transition: padding-left .25s ease; }
.rows li:hover { padding-left: .75rem; }
.rows li:hover .tag { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .js .hero-side, .js .portrait, .js .hero-actions, .js .reveal { opacity: 1; transform: none; animation: none !important; transition: none; }
}
