/* =================================================================
   XYZ — Landing Page Stylesheet
   Concept: a company that resolves unknowns. Two solid colors only
   (ink / paper), alternated section by section like a binary flip.
   Signature motif: three blobs — X, Y, Z — merging into one liquid
   shape. Everything else stays quiet so that idea can carry the page.
   ================================================================= */

/* ---------- Tokens ---------- */
:root {
  --ink:        #15171A;   /* solid dark */
  --paper:      #F0F0EC;   /* solid light */
  --ink-soft:   rgba(21, 23, 26, 0.62);
  --paper-soft: rgba(240, 240, 236, 0.62);
  --line-on-paper: rgba(21, 23, 26, 0.14);
  --line-on-ink:   rgba(240, 240, 236, 0.18);

  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  --font-body:    'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --radius: 3px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur-fast: .25s;
  --dur-med: .6s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }
img, picture, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

h1, h2, h3, .font-display { font-family: var(--font-display); letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); }

/* visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* ---------- Section color alternation (the "two solid colors" architecture) ---------- */
.section { position: relative; padding-block: clamp(4.5rem, 10vw, 8rem); }
.section--paper { background: var(--paper); color: var(--ink); }
.section--ink   { background: var(--ink);   color: var(--paper); }

.section--ink .rule { border-color: var(--line-on-ink); }
.section--paper .rule { border-color: var(--line-on-paper); }

.eyebrow {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.axis-tags { display: inline-flex; gap: .4rem; }
.axis-tags span {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: .15rem .6rem;
  opacity: .85;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line-on-paper);
  transition: background var(--dur-fast) var(--ease);
}
.nav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.15rem;
}
.nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.nav__logo span { opacity: .45; }

.nav__links {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .02em;
}
.nav__links a {
  position: relative;
  padding-bottom: 2px;
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transition: right var(--dur-fast) var(--ease);
}
.nav__links a:hover::after { right: 0; }

.nav__cta {
  display: none;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  z-index: 110;
}
.nav__toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.nav--open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav--open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav--open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(7.5rem, 16vw, 10.5rem);
  padding-bottom: clamp(4rem, 10vw, 7rem);
  min-height: 92vh;
  display: flex;
  align-items: center;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  line-height: 1.04;
  font-weight: 500;
  max-width: 14ch;
}
.hero__sub {
  margin-top: 1.6rem;
  max-width: 42ch;
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  color: var(--ink-soft);
}
.hero__actions {
  margin-top: 2.4rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .95rem 1.7rem;
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--solid {
  background: var(--ink);
  color: var(--paper);
}
.section--paper .btn--solid:hover { background: transparent; color: var(--ink); }
.section--ink .btn--solid { background: var(--paper); color: var(--ink); }
.section--ink .btn--solid:hover { background: transparent; color: var(--paper); }

.btn--ghost:hover { background: currentColor; }
.section--paper .btn--ghost:hover { color: var(--paper); }
.section--ink .btn--ghost:hover { color: var(--ink); }

.btn--full { width: 100%; justify-content: center; }

/* ---------- Liquid metaball stage ---------- */
.liquid-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 460px;
  margin-inline: auto;
  filter: url(#xyz-goo);
}
.blob {
  position: absolute;
  border-radius: 50%;
  background: var(--ink);
  will-change: transform;
}
.section--ink .blob { background: var(--paper); }

.blob--x { width: 42%; height: 42%; top: 8%;  left: 6%;  animation: floatX 9s var(--ease) infinite; }
.blob--y { width: 38%; height: 38%; top: 30%; left: 46%; animation: floatY 11s var(--ease) infinite; }
.blob--z { width: 34%; height: 34%; top: 52%; left: 18%; animation: floatZ 13s var(--ease) infinite; }

@keyframes floatX {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(10%, 14%) scale(1.08); }
}
@keyframes floatY {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-14%, 8%) scale(0.92); }
}
@keyframes floatZ {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(8%, -12%) scale(1.1); }
}

.liquid-caption {
  margin-top: 1.25rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* small divider blob used between sections */
.divider-stage {
  width: 84px;
  aspect-ratio: 1/1;
  filter: url(#xyz-goo);
  margin: 0 auto clamp(2.5rem, 6vw, 3.5rem);
}
.divider-stage .blob--x { width: 46%; height: 46%; top: 6%; left: 4%; animation-duration: 7s; }
.divider-stage .blob--y { width: 40%; height: 40%; top: 28%; left: 42%; animation-duration: 8.5s; }
.divider-stage .blob--z { width: 36%; height: 36%; top: 46%; left: 16%; animation-duration: 10s; }

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: clamp(2rem, 6vw, 5rem);
}
.about h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 500;
  line-height: 1.15;
}
.about__body p { max-width: 60ch; color: var(--paper-soft); }
.about__body p + p { margin-top: 1.1rem; }

.value-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 2rem;
}
.value-tags span {
  border: 1px solid var(--line-on-ink);
  border-radius: 999px;
  padding: .45rem 1rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---------- Services ---------- */
.section-head {
  max-width: 56ch;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}
.section-head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 500;
  line-height: 1.15;
  margin-top: .6rem;
}
.section-head p {
  margin-top: 1rem;
  color: var(--ink-soft);
  max-width: 52ch;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2rem);
}
.service-card {
  border: 1px solid var(--line-on-paper);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 3vw, 2.4rem);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.service-card:hover {
  transform: translateY(-4px);
}
.service-card__mark {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1;
  opacity: .9;
}
.service-card h3 {
  margin-top: 1.1rem;
  font-size: 1.15rem;
  font-weight: 600;
}
.service-card p {
  margin-top: .65rem;
  color: var(--ink-soft);
  font-size: .96rem;
}

/* ---------- Contact ---------- */
.contact__grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: clamp(2.5rem, 6vw, 5rem);
}
.contact-info h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 500;
  line-height: 1.15;
}
.contact-info p.lede {
  margin-top: 1rem;
  color: var(--paper-soft);
  max-width: 42ch;
}

.contact-list { margin-top: 2.2rem; display: flex; flex-direction: column; gap: 1rem; }
.contact-list a, .contact-list div {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  font-size: 1rem;
}
.contact-list .label {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--paper-soft);
  width: 5.5rem;
  flex: none;
}
.contact-list a { border-bottom: 1px solid transparent; transition: border-color var(--dur-fast) var(--ease); }
.contact-list a:hover { border-color: currentColor; }

.social-row {
  display: flex;
  gap: .9rem;
  margin-top: 2.4rem;
}
.social-row a {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-on-ink);
  border-radius: 999px;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.social-row a:hover {
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-2px);
}
.social-row svg { width: 18px; height: 18px; }

/* ---------- Form ---------- */
.form {
  display: grid;
  gap: 1.25rem;
}
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.field { display: flex; flex-direction: column; gap: .5rem; }
.field label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--paper-soft);
}
.field input,
.field textarea {
  background: transparent;
  border: 1px solid var(--line-on-ink);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  color: var(--paper);
  transition: border-color var(--dur-fast) var(--ease);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--paper-soft); }
.field input:focus,
.field textarea:focus { border-color: var(--paper); outline: none; }
.field textarea { resize: vertical; min-height: 130px; }

/* honeypot — hidden from real visitors, present for bots */
.field--trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__status {
  min-height: 1.4em;
  font-size: .92rem;
  font-family: var(--font-mono);
}
.form__status[data-state="success"] { color: #9fe6b8; }
.form__status[data-state="error"]   { color: #f2a6a6; }

/* ---------- Footer ---------- */
.footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--line-on-paper);
}
.footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.footer__copy {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--ink-soft);
}
.footer .social-row a { border-color: var(--line-on-paper); width: 36px; height: 36px; }
.footer .social-row a:hover { background: var(--ink); color: var(--paper); }
.footer .social-row svg { width: 15px; height: 15px; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Mobile nav overlay ---------- */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--ink);
  color: var(--paper);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transform: translateY(-100%);
  transition: transform var(--dur-med) var(--ease);
}
.nav-overlay.is-open { transform: translateY(0); }
.nav-overlay a {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; text-align: left; }
  .hero .liquid-stage { max-width: 320px; margin-top: 1rem; }
  .about__grid,
  .contact__grid { grid-template-columns: 1fr; }
  .services__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .services__grid { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .contact-list .label { width: 4.4rem; }
  .footer__row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .hero h1 { max-width: 100%; }
  .section { padding-block: clamp(3.5rem, 14vw, 5rem); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob { animation: none !important; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * { transition-duration: .01ms !important; }
}
