/* ------------------------------------------------------------------
   Homeworld Studio — homeworld.studio
   Type: Inter Tight (Google). Swap --font for Helvetica Now Display
   if the studio's licensed files are added to /assets/fonts.
------------------------------------------------------------------ */

:root {
  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --paper: #f4f2ed;
  --ink: #121212;
  --muted: #6f6d67;
  --line: rgba(18, 18, 18, 0.18);
  --green: #004135;
  --green-deep: #00291f;
  --paper-on-green: #eef2ee;
  --line-on-green: rgba(238, 242, 238, 0.28);
  --gutter: clamp(16px, 2vw, 28px);
  --topbar-h: 2.75rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
section[id] { scroll-margin-top: calc(var(--topbar-h) * 2 + 2px); }
.label-row:first-child { border-top: 0; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.6; }
sup { font-size: 0.42em; vertical-align: super; line-height: 0; margin-left: 0.04em; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: 400; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ---------- Top bar ---------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  font-size: clamp(0.95rem, 1.15vw, 1.15rem);
  line-height: 1;
  color: #fff;
  background: transparent;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
.topbar__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: var(--topbar-h);
  padding: 0 var(--gutter);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  transition: border-color 0.35s var(--ease);
}
.topbar__row--sub { grid-template-columns: 1fr auto; }
.topbar__brand { justify-self: start; }
.topbar__meta  { justify-self: center; opacity: 0.7; }
.topbar__link  { justify-self: end; }
.topbar__nav   { display: flex; gap: 1.5em; }
.topbar__contact { justify-self: end; }

/* Once the hero has scrolled past, the bar sits on paper */
.topbar.is-solid { background: var(--paper); color: var(--ink); }
.topbar.is-solid .topbar__row { border-color: var(--line); }
.topbar.is-solid .topbar__meta { opacity: 1; color: var(--muted); }

@media (max-width: 640px) {
  .topbar__row { grid-template-columns: 1fr auto; }
  .topbar__meta { display: none; }
}

/* ---------- Hero (full bleed, above the fold) ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--topbar-h) * 2 + 2rem) var(--gutter) clamp(1.5rem, 3.5vw, 3rem);
  background: var(--green);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  z-index: -2;
}
.hero::after {
  /* keeps white type legible on the floor without muddying the photo */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.08) 45%, rgba(0, 0, 0, 0.18) 100%);
  pointer-events: none;
}
.hero__title {
  font-size: clamp(2.75rem, 8.4vw, 9.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 12ch;
}
.hero__title .line { display: block; opacity: 0; transform: translateY(0.25em); animation: rise 1s var(--ease) forwards; }
.hero__title .line:nth-child(2) { animation-delay: 0.08s; }
.hero__title .line:nth-child(3) { animation-delay: 0.16s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.manifesto { padding-top: clamp(4rem, 8vw, 8rem); }

/* ---------- Section labels ---------- */

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem var(--gutter);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: clamp(0.95rem, 1.15vw, 1.15rem);
}
.label--right { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Manifesto ---------- */

.manifesto { margin-bottom: clamp(5rem, 10vw, 10rem); }

.manifesto__item {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  padding: clamp(1.75rem, 3.5vw, 3.25rem) var(--gutter);
  border-bottom: 1px solid var(--line);
}
.manifesto__num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 0.45em;
  font-size: clamp(0.95rem, 1.15vw, 1.15rem);
}
.manifesto__text {
  font-size: clamp(1.75rem, 4.2vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 20ch;
  text-wrap: balance;
}
@media (max-width: 640px) {
  .manifesto__item { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ---------- Clients ---------- */

.clients { margin-bottom: clamp(5rem, 10vw, 10rem); }

.clients__list li {
  padding: 0.12em var(--gutter);
  border-bottom: 1px solid var(--line);
  font-size: clamp(2.25rem, 6.5vw, 7rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  transition: color 0.35s var(--ease), padding-left 0.5s var(--ease);
}
@media (hover: hover) {
  .clients__list li:hover { color: var(--green); padding-left: calc(var(--gutter) + 0.35em); }
}

/* ---------- Contact ---------- */

.contact {
  background: var(--green);
  color: var(--paper-on-green);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(2rem, 6vw, 8rem);
  padding: clamp(3rem, 6vw, 6rem) var(--gutter) clamp(4rem, 8vw, 8rem);
  border-top: 1px solid var(--line);
}
.contact a:hover { opacity: 0.7; }

.contact__title {
  font-size: clamp(2.25rem, 5.2vw, 5.5rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  text-wrap: balance;
  max-width: 12ch;
  margin-bottom: 2rem;
}
.contact__aside {
  font-size: clamp(1rem, 1.3vw, 1.3rem);
  line-height: 1.45;
  margin-bottom: 0;
}
.contact__aside a { border-bottom: 1px solid var(--line-on-green); }
/* Form */

.form { padding-top: 0.35rem; }
.form__lead {
  font-size: clamp(1rem, 1.3vw, 1.3rem);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line-on-green);
  margin-bottom: 0.25rem;
}
.field {
  display: grid;
  gap: 0.35rem;
  padding: 1.1rem 0 0.9rem;
  border-bottom: 1px solid var(--line-on-green);
}
.field label {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(238, 242, 238, 0.7);
}
.field .opt { text-transform: none; letter-spacing: 0; }
.field input,
.field textarea {
  font: inherit;
  font-size: clamp(1.15rem, 1.6vw, 1.6rem);
  line-height: 1.3;
  color: var(--paper-on-green);
  background: transparent;
  border: 0;
  padding: 0;
  width: 100%;
  border-radius: 0;
  resize: vertical;
  min-height: 1.6em;
}
.field input:focus,
.field textarea:focus { outline: none; }
.field:focus-within label { color: var(--paper-on-green); }
.field input:-webkit-autofill,
.field textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--paper-on-green);
  -webkit-box-shadow: 0 0 0 1000px var(--green) inset;
  transition: background-color 9999s;
}
.field.is-invalid label { color: #ffb3a7; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding-top: 1.75rem;
}
.button {
  font: inherit;
  font-size: clamp(1rem, 1.3vw, 1.3rem);
  line-height: 1;
  color: var(--paper-on-green);
  background: transparent;
  border: 1px solid var(--paper-on-green);
  border-radius: 999px;
  padding: 0.85em 1.6em;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), opacity 0.25s;
}
.button:hover { background: var(--paper-on-green); color: var(--green); }
.button:disabled { opacity: 0.5; cursor: default; }
.form__status { font-size: 0.95rem; color: rgba(238, 242, 238, 0.85); min-height: 1.2em; }
.form__status a { border-bottom: 1px solid var(--line-on-green); }
.form.is-sent .field, .form.is-sent .form__lead { opacity: 0.35; }

@media (max-width: 860px) {
  .contact { grid-template-columns: 1fr; gap: 3rem 0; }
}

/* ---------- Footer ---------- */

.footer {
  background: var(--paper);
  color: var(--ink);
  padding-top: clamp(4rem, 8vw, 8rem);
  border-top: 1px solid var(--line);
}
.footer__wordmark {
  font-size: clamp(2.2rem, 11.2vw, 13.5rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
  white-space: nowrap;
  overflow: hidden;
  padding: 0 var(--gutter) 0.05em;
  border-bottom: 1px solid var(--line);
}
.footer__wordmark sup { font-size: 0.22em; vertical-align: top; position: relative; top: 0.5em; }
.footer__row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding: 0.85rem var(--gutter) 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.footer__links { display: flex; gap: 1.5rem; }
@media (max-width: 640px) {
  .footer__meta { display: none; }
}

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__title .line { animation: none; opacity: 1; transform: none; }
  .clients__list li { transition: none; }
}
