/* Vanalinna Meister — redesign prototype
   Direction: cool limestone + moss stewardship, Old Town photography */

:root {
  --ink: #141816;
  --ink-soft: #2a2e2b;
  --moss: #2c4538;
  --moss-mid: #3a5848;
  --stone: #dcd9d2;
  --mist: #f3f2ef;
  --paper: #ebe9e4;
  --slate: #5e635e;
  --line: rgba(20, 24, 22, 0.12);
  --white: #fafaf8;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Sora", "Avenir Next", "Segoe UI", sans-serif;

  --space: clamp(1.25rem, 3vw, 2.5rem);
  --max: 72rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 4.25rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(44, 69, 56, 0.08), transparent 55%),
    linear-gradient(180deg, var(--mist) 0%, var(--paper) 48%, var(--mist) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--moss);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.wrap {
  width: min(100% - 2 * var(--space), var(--max));
  margin-inline: auto;
}

/* ——— Header ——— */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled,
.site-header.is-solid {
  background: #f3f2ef;
  border-bottom-color: var(--line);
}

.site-header.is-over-hero:not(.is-scrolled) {
  color: var(--white);
}

.site-header.is-over-hero:not(.is-scrolled) .nav-toggle span {
  background: var(--white);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(100% - 2 * var(--space), var(--max));
  margin-inline: auto;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 550;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  z-index: 120;
}

.brand span {
  font-weight: 400;
  opacity: 0.72;
  font-size: 0.72em;
  margin-left: 0.35em;
}

.nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1rem, 2.5vw, 2rem);
  width: min(100% - 2 * var(--space), var(--max));
  height: var(--header-h);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
  color: inherit;
}

.nav > * {
  pointer-events: auto;
}

/* Match header text on hero */
.site-header.is-over-hero:not(.is-scrolled) ~ .nav {
  color: var(--white);
}

.nav a:not(.nav-cta) {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  position: relative;
  padding: 0.2rem 0;
}

.nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.15rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav a:not(.nav-cta):hover::after,
.nav a:not(.nav-cta)[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--moss);
  background: var(--moss);
  color: var(--white) !important;
  text-decoration: none !important;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1;
  box-shadow: none;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
    color 0.25s var(--ease), transform 0.25s var(--ease);
}

.nav-cta:hover {
  background: var(--moss-mid);
  border-color: var(--moss-mid);
  color: var(--white) !important;
}

.site-header.is-over-hero:not(.is-scrolled) ~ .nav .nav-cta {
  background: var(--white);
  border-color: var(--white);
  color: var(--ink) !important;
}

.site-header.is-over-hero:not(.is-scrolled) ~ .nav .nav-cta:hover {
  background: var(--mist);
  border-color: var(--mist);
  color: var(--ink) !important;
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1.35rem;
  height: 1.5px;
  margin: 0.28rem auto;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--moss);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--moss-mid);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
}

.btn-on-light.btn-ghost {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-on-light.btn-ghost:hover {
  background: var(--ink);
  color: var(--white);
}

/* ——— Hero (home) ——— */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  color: var(--white);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 40%;
  transform: scale(1.06);
  animation: hero-drift 18s var(--ease) infinite alternate;
}

@keyframes hero-drift {
  from {
    transform: scale(1.06) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.12) translate3d(-1.5%, -1%, 0);
  }
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 24, 22, 0.35) 0%, rgba(20, 24, 22, 0.15) 35%, rgba(20, 24, 22, 0.78) 100%),
    linear-gradient(90deg, rgba(20, 24, 22, 0.45) 0%, transparent 55%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: calc(var(--header-h) + 3rem) 0 4.5rem;
  width: min(100% - 2 * var(--space), var(--max));
  margin-inline: auto;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin: 0 0 1.25rem;
  max-width: 12ch;
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.15s forwards;
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 400;
  line-height: 1.5;
  max-width: 34rem;
  margin: 0 0 1.75rem;
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.35s forwards;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.5s forwards;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ——— Page hero (inner) ——— */
.page-hero {
  padding: calc(var(--header-h) + 3.5rem) 0 3rem;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 70% at 0% 0%, rgba(44, 69, 56, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(220, 217, 210, 0.55), transparent 70%);
  pointer-events: none;
}

.page-hero .wrap {
  position: relative;
}

.page-hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  max-width: 14ch;
}

.page-hero .lede {
  max-width: 38rem;
  color: var(--slate);
  font-size: 1.1rem;
}

/* ——— Sections ——— */
.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.section-tight {
  padding: clamp(2.5rem, 5vw, 3.5rem) 0;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

.section-intro {
  max-width: 40rem;
  color: var(--slate);
  margin-bottom: 2.5rem;
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.split-reverse {
  grid-template-columns: 0.95fr 1.05fr;
}

.split-reverse .split-copy {
  order: 2;
}

.split-media {
  position: relative;
  min-height: 18rem;
  background: var(--stone);
  overflow: hidden;
}

.split-media img {
  width: 100%;
  height: 100%;
  min-height: 22rem;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

.split:hover .split-media img {
  transform: scale(1.04);
}

.prose {
  max-width: 40rem;
}

.prose p + p {
  margin-top: 1rem;
}

.eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 0.85rem;
}

/* ——— Service list (not cards — editorial rows) ——— */
.service-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.service-row {
  display: grid;
  grid-template-columns: minmax(10rem, 16rem) 1fr;
  gap: 1.5rem 2.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--line);
}

.service-row h3 {
  font-size: 1.35rem;
  margin: 0;
}

.service-row p {
  color: var(--ink-soft);
  margin: 0;
}

.bullet-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.bullet-list li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--ink-soft);
}

.bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 0.4rem;
  height: 1px;
  background: var(--moss);
}

/* ——— Partners ——— */
.partner-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.55rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--slate);
  font-size: 0.92rem;
}

.partner-strip li {
  margin: 0;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

/* ——— Team ——— */
.team-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  column-gap: 2.5rem;
  border-top: 1px solid var(--line);
}

.person {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}

.person h3 {
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
}

.person-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.88rem;
  color: var(--slate);
}

.person-meta a {
  text-decoration: none;
}

.person-meta a:hover {
  text-decoration: underline;
}

/* ——— CTA band ——— */
.cta-band {
  background: var(--ink);
  color: var(--white);
  padding: clamp(3rem, 7vw, 5rem) 0;
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: auto -10% -40% 40%;
  height: 120%;
  background: radial-gradient(circle, rgba(44, 69, 56, 0.55), transparent 65%);
  pointer-events: none;
}

.cta-band .wrap {
  position: relative;
  display: grid;
  gap: 1.5rem;
  align-items: end;
  grid-template-columns: 1.4fr auto;
}

.cta-band h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  max-width: 16ch;
  margin: 0 0 0.75rem;
}

.cta-band p {
  max-width: 32rem;
  opacity: 0.8;
  margin: 0;
}

.cta-band .btn-primary {
  background: var(--white);
  color: var(--ink);
}

.cta-band .btn-primary:hover {
  background: var(--mist);
}

.cta-band .btn-ghost {
  border-color: rgba(250, 250, 248, 0.55);
  color: var(--white);
}

.cta-band .btn-ghost:hover {
  background: rgba(250, 250, 248, 0.1);
  color: var(--white);
}

/* Page hero is always above the fold */
.page-hero .reveal {
  opacity: 1;
  transform: none;
}

/* ——— Contact facts ——— */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.75rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.fact dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 0.35rem;
}

.fact dd {
  margin: 0;
  font-size: 0.98rem;
}

.fact a {
  text-decoration: none;
}

.fact a:hover {
  text-decoration: underline;
}

/* ——— Footer ——— */
.site-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--slate);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem 2rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* ——— Reveal on scroll ——— */
.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.1s;
}
.reveal-delay-2 {
  transition-delay: 0.2s;
}
.reveal-delay-3 {
  transition-delay: 0.3s;
}

/* ——— Audience (about) ——— */
.audience {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.audience li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  border: 0;
  text-decoration: none;
}

.audience li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 0.4rem;
  height: 1px;
  background: var(--moss);
}

/* ——— Mobile ——— */
@media (max-width: 860px) {
  .nav-toggle {
    display: block;
    position: relative;
    z-index: 120;
  }

  /* Fullscreen drawer outside header — hidden until opened */
  .nav {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    transform: none;
    margin: 0;
    z-index: 110;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 0.35rem;
    padding: calc(var(--header-h) + 1.5rem) var(--space) 2rem;
    background: #f3f2ef;
    color: var(--ink);
    pointer-events: auto;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a:not(.nav-cta) {
    font-size: 1.45rem;
    font-family: var(--font-display);
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line);
  }

  .nav a:not(.nav-cta)::after {
    display: none;
  }

  .nav-cta {
    align-self: flex-start;
    margin-top: 1.25rem;
    min-height: 3rem;
    font-size: 1rem;
    padding: 0.85rem 1.4rem;
  }

  /* Hero page: closed desktop-style color rules don't apply to drawer */
  .site-header.is-over-hero:not(.is-scrolled) ~ .nav {
    color: var(--ink);
  }

  .site-header.is-over-hero:not(.is-scrolled) ~ .nav .nav-cta {
    background: var(--moss);
    border-color: var(--moss);
    color: var(--white) !important;
  }

  body.nav-open {
    overflow: hidden;
  }

  .nav-toggle.is-open span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }
  .nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.is-open span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .site-header.is-over-hero:not(.is-scrolled) .nav-toggle.is-open span {
    background: var(--ink);
  }

  .partner-strip {
    grid-template-columns: 1fr;
  }

  .team-list {
    grid-template-columns: 1fr;
  }

  .split,
  .split-reverse {
    grid-template-columns: 1fr;
  }

  .split-reverse .split-copy {
    order: 0;
  }

  .service-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .cta-band .wrap {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding-bottom: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-media img {
    transform: none;
  }
}
