/* ==========================================================================
   D1 Group — tokens
   ========================================================================== */
:root {
  --ink: #12171c;
  --ink-soft: #29343c;
  --paper: #f2eee4;
  --sand: #e3d9c1;
  --sea: #33564f;
  --sea-bright: #7fa79c;
  --line-on-dark: rgba(242, 238, 228, 0.3);
  --line-on-light: rgba(18, 23, 28, 0.16);
  --shadow: 0 30px 60px -30px rgba(18, 23, 28, 0.35);

  --font-display: "Bricolage Grotesque", "Arial Black", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --fs-h1: clamp(2.6rem, 5vw + 1.2rem, 6.2rem);
  --fs-h2: clamp(1.9rem, 2.4vw + 1rem, 3.1rem);
  --fs-h3: clamp(1.2rem, 0.6vw + 1rem, 1.5rem);
  --fs-lede: clamp(1.05rem, 0.4vw + 0.95rem, 1.25rem);
  --fs-label: 0.85rem;
  --fs-label-sm: 0.8rem;

  --gap: clamp(1.25rem, 3vw, 2.5rem);
  --section-pad: clamp(4rem, 8vw, 7.5rem);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, p {
  margin: 0;
}

.mono {
  font-family: var(--font-mono);
}

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sea);
  margin-bottom: 0.9rem;
}

.eyebrow--light {
  color: var(--sea-bright);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 18ch;
}

/* Focus visibility */
a:focus-visible,
button:focus-visible,
main:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 3px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 2px;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

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

.btn--solid.btn--light {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.btn--solid.btn--light:hover {
  background: var(--sea-bright);
  border-color: var(--sea-bright);
}

.btn--ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--line-on-dark);
}
.btn--ghost:hover {
  border-color: var(--paper);
}

.btn--line {
  color: var(--ink);
  border-color: var(--line-on-light);
  padding: 0.6rem 1.2rem;
}
.btn--line:hover {
  border-color: var(--ink);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.15rem;
}
.link-arrow::after {
  content: "→";
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}
.link-arrow:hover::after {
  transform: translateX(4px);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 40;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(242, 238, 228, 0.92);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--line-on-light);
}

.site-header__row {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: 1.1rem;
}

.site-header__mark img {
  height: 34px;
  width: auto;
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}
.site-header.is-scrolled .site-header__mark img {
  filter: none;
}

.site-header__nav {
  display: none;
  gap: clamp(1.25rem, 2vw, 2.25rem);
  margin-inline-start: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.03em;
  color: var(--paper);
  transition: color 0.3s ease;
}
.site-header.is-scrolled .site-header__nav {
  color: var(--ink);
}
.site-header__nav a {
  position: relative;
}
.site-header__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.site-header__nav a:hover::after {
  transform: scaleX(1);
}

.site-header__cta {
  display: none;
  color: var(--paper);
  border-color: var(--line-on-dark);
  transition: color 0.3s ease, border-color 0.3s ease;
}
.site-header.is-scrolled .site-header__cta {
  color: var(--ink);
  border-color: var(--line-on-light);
}

.site-header__burger {
  margin-inline-start: auto;
  width: 44px;
  height: 44px;
  padding: 5px;
  box-sizing: border-box;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.site-header__burger span {
  height: 1px;
  background: var(--paper);
  transition: background-color 0.3s ease;
}
.site-header.is-scrolled .site-header__burger span {
  background: var(--ink);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 1.5rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  background: var(--paper);
  color: var(--ink);
}
.mobile-nav.is-open {
  display: flex;
}
.mobile-nav a {
  display: block;
  padding-block: 0.7rem;
}

@media (min-width: 860px) {
  .site-header__nav,
  .site-header__cta {
    display: inline-flex;
  }
  .site-header__burger {
    display: none;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 55% at 78% 12%, rgba(127, 167, 156, 0.22), transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%);
  z-index: 0;
}

.hero__sky {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  padding-block: clamp(6rem, 14vh, 9rem) 4rem;
}

.hero__content {
  max-width: 46rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--paper);
}
.hero__title em {
  font-style: normal;
  color: var(--sea-bright);
}

.hero__lede {
  margin-top: 1.75rem;
  max-width: 34rem;
  font-size: var(--fs-lede);
  color: rgba(242, 238, 228, 0.78);
}

.hero__actions {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Hero entrance — tick cascade: eyebrow draws in like a ruler tick,
   then title/lede/actions rise in sequence. */
.hero__eyebrow--tick {
  clip-path: inset(0 100% 0 0);
  border-left: 2px solid var(--sea);
  padding-left: 0.5rem;
  margin-left: -0.5rem;
  animation: hero-tick 420ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__title-line {
  display: block;
  opacity: 0;
  transform: translateY(14px);
  animation: hero-cascade 480ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero__title-line:nth-child(1) { animation-delay: 110ms; }
.hero__title-line:nth-child(2) { animation-delay: 220ms; }
.hero__title-line:nth-child(3) { animation-delay: 330ms; }

.hero__sky .hero__lede,
.hero__sky .hero__actions {
  opacity: 0;
  transform: translateY(14px);
  animation: hero-cascade 480ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero__sky .hero__lede { animation-delay: 440ms; }
.hero__sky .hero__actions { animation-delay: 550ms; }

@keyframes hero-tick {
  to { clip-path: inset(0 0 0 0); }
}
@keyframes hero-cascade {
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Horizon — signature motif
   ========================================================================== */
.horizon {
  position: relative;
  z-index: 1;
}

.horizon--hero {
  height: clamp(72px, 12vh, 120px);
  background: linear-gradient(180deg, transparent, var(--paper) 92%);
}

.horizon__wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  width: 100%;
  height: 40px;
  stroke: var(--sea-bright);
  stroke-width: 1.5;
  fill: none;
  opacity: 0.85;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw-horizon 2.4s 0.4s ease-out forwards;
}

@keyframes draw-horizon {
  to {
    stroke-dashoffset: 0;
  }
}

.horizon__coord {
  position: absolute;
  right: clamp(1.25rem, 4vw, 3rem);
  bottom: 2px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  opacity: 0.55;
}

.horizon--line {
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--line-on-light) 0,
    var(--line-on-light) 1px,
    transparent 1px,
    transparent 48px
  );
  margin-inline: clamp(1.25rem, 4vw, 3rem);
}

/* ==========================================================================
   Pillars
   ========================================================================== */
.pillars {
  padding-block: clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--line-on-light);
}

.pillars__grid {
  display: grid;
  gap: 2.5rem;
}

.pillar {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-on-light);
}

.pillar__mark {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sea);
  margin-bottom: 0.85rem;
}

.pillar p {
  max-width: 32ch;
  color: var(--ink-soft);
}

@media (min-width: 780px) {
  .pillars__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   About
   ========================================================================== */
.about {
  padding-block: var(--section-pad);
}

.about__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.about__mark img {
  width: 100%;
  max-width: 320px;
}

.about__text > * + * {
  margin-top: 1.1rem;
}

.about__text h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.12;
}

.about__text p {
  max-width: 46ch;
  color: var(--ink-soft);
}

@media (min-width: 860px) {
  .about__grid {
    grid-template-columns: 0.8fr 1.2fr;
  }
}

/* ==========================================================================
   Projects
   ========================================================================== */
.projects {
  padding-block: var(--section-pad);
  background: var(--sand);
}

.projects__grid {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  gap: 1.5rem;
}

.project {
  background: var(--paper);
  border: 1px solid var(--line-on-light);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.project--feature {
  grid-column: 1 / -1;
}

@media (min-width: 780px) {
  .project--feature {
    flex-direction: row;
  }
  .project--feature .project__media {
    flex: 0 0 40%;
  }
  .project--feature .project__body {
    flex: 1;
  }
}

.project__media {
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
}
.project__media img {
  filter: brightness(0) invert(1);
  max-width: 220px;
}

.project__body {
  padding: clamp(1.75rem, 3vw, 3rem);
}

.project__status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sea);
  border: 1px solid var(--sea);
  padding: 0.25rem 0.6rem;
  margin-bottom: 1rem;
}

.project__status--soon {
  color: var(--ink-soft);
  border-color: var(--line-on-light);
}

.project h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  margin-bottom: 0.4rem;
}

.project__tag {
  font-size: var(--fs-label);
  color: var(--sea);
  margin-bottom: 1rem;
}

.project__body p {
  color: var(--ink-soft);
  max-width: 48ch;
}

.project__body .link-arrow {
  margin-top: 1.25rem;
}

.project--placeholder {
  border-style: dashed;
  background: transparent;
}
.project--placeholder:hover {
  transform: none;
  box-shadow: none;
}

@media (min-width: 780px) {
  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Process
   ========================================================================== */
.process {
  padding-block: var(--section-pad);
}

.process__grid {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: grid;
  gap: 2rem;
}

.process__step {
  position: relative;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-on-light);
}

.process__num {
  display: block;
  font-size: var(--fs-label);
  color: var(--sea);
  margin-bottom: 0.75rem;
}

.process__step h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.process__step p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

@media (min-width: 780px) {
  .process__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.cta-band__row {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

.cta-band h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.1;
  max-width: 20ch;
}

@media (min-width: 780px) {
  .cta-band__row {
    flex-direction: row;
    align-items: center;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--sand);
  padding-block: clamp(3rem, 6vw, 5rem) 1.5rem;
}

.site-footer__top {
  display: grid;
  gap: 2.5rem;
}

.site-footer__brand {
  max-width: 26rem;
}
.site-footer__logo {
  height: 30px;
  width: auto;
  margin-bottom: 1rem;
}
.site-footer__brand p {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.site-footer__col .eyebrow {
  margin-bottom: 0.3rem;
}

.site-footer__coord .mono {
  font-size: var(--fs-label-sm);
  color: var(--ink-soft);
  line-height: 1.5;
}

.site-footer__bottom {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-on-light);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  font-size: var(--fs-label-sm);
  color: var(--ink-soft);
}

@media (min-width: 780px) {
  .site-footer__top {
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
  }
}

/* ==========================================================================
   Simple fallback page (index.php)
   ========================================================================== */
.simple-page {
  padding-block: calc(var(--section-pad) + 4rem) var(--section-pad);
}
.simple-page__body {
  max-width: 60ch;
  margin-top: 1.5rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .horizon__wave {
    animation: none;
    stroke-dashoffset: 0;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
