/* =========================================================
   Moritz Merten — Garten- und Landschaftsbau
   Design language: editorial monograph. Quiet serif headlines
   on parchment, moss accent, asymmetric grid, slow motion.
   ========================================================= */

@layer reset, tokens, base, layout, components, motion, utilities;

/* ---------- Reset ----------------------------------------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html, body, h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, ol, ul { margin: 0; padding: 0; }
  ul[role="list"], ol[role="list"] { list-style: none; }
  html:focus-within { scroll-behavior: smooth; }
  body { min-height: 100vh; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
  img, picture, svg, video { display: block; max-width: 100%; height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  a { color: inherit; text-decoration: none; }
  ::selection { background: color-mix(in oklab, var(--ink) 80%, var(--moss)); color: var(--paper); }
}

/* ---------- Design tokens --------------------------------- */
@layer tokens {
  :root {
    /* Palette — earth, parchment, moss */
    --paper:        #F4EFE5;
    --paper-2:      #ECE5D5;
    --sand:         #D9CFBB;
    --lichen:       #9C9A8C;
    --ink:          #1F1B17;
    --ink-soft:     #3A332B;
    --moss:         #5B6A4A;
    --moss-deep:    #3F4B33;
    --patina:       #8B6F4E;
    --rust:         #A24A28;

    /* Typography — system stack, no external fetch */
    --serif: "Iowan Old Style","Hoefler Text","Cormorant Garamond",
             ui-serif,Georgia,Cambria,"Times New Roman",Times,serif;
    --sans:  ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,
             "Helvetica Neue",Arial,"Noto Sans",sans-serif;
    --mono:  ui-monospace,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;

    /* Fluid type scale */
    --fs-overline: clamp(.72rem, .68rem + .15vw, .82rem);
    --fs-meta:     clamp(.82rem, .78rem + .2vw, .92rem);
    --fs-body:     clamp(1rem, .96rem + .2vw, 1.08rem);
    --fs-lead:     clamp(1.18rem, 1.04rem + .6vw, 1.4rem);
    --fs-h4:       clamp(1.3rem, 1.16rem + .7vw, 1.62rem);
    --fs-h3:       clamp(1.7rem, 1.4rem + 1.4vw, 2.4rem);
    --fs-h2:       clamp(2.2rem, 1.6rem + 2.6vw, 3.6rem);
    --fs-h1:       clamp(2.8rem, 2rem + 4.4vw, 5.6rem);
    --fs-display:  clamp(3.4rem, 2.2rem + 6.2vw, 7.6rem);

    /* Spacing — based on a 1rem foot, eight-point system */
    --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem;
    --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4rem;
    --s-9: 6rem; --s-10: 9rem; --s-11: 12rem;

    /* Layout */
    --measure: 62ch;
    --gutter: clamp(1.25rem, 2vw + .5rem, 2.25rem);
    --max:    1440px;

    /* Motion */
    --ease: cubic-bezier(.2,.6,.1,1);
    --ease-out: cubic-bezier(.16,1,.3,1);
    --dur-1: 240ms;
    --dur-2: 520ms;
    --dur-3: 900ms;

    /* Lines & forms */
    --hairline: 1px solid color-mix(in oklab, var(--ink) 22%, transparent);
    --hairline-strong: 1px solid color-mix(in oklab, var(--ink) 55%, transparent);
    --radius: 2px;
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: .001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: .001ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* ---------- Base ----------------------------------------- */
@layer base {
  html { font-family: var(--sans); color: var(--ink); background: var(--paper); }
  body {
    font-size: var(--fs-body);
    background:
      radial-gradient(1200px 600px at 80% -10%, color-mix(in oklab, var(--sand) 60%, transparent), transparent 60%),
      radial-gradient(900px 500px at -10% 110%, color-mix(in oklab, var(--moss) 14%, transparent), transparent 60%),
      var(--paper);
    background-attachment: fixed;
  }

  /* Subtle paper grain via SVG noise */
  body::before {
    content: "";
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0 0.08  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.9'/></svg>");
    background-size: 220px 220px;
    opacity: .55;
    mix-blend-mode: multiply;
  }

  main, footer, header { position: relative; z-index: 1; }

  h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -.012em;
    line-height: 1.04;
    text-wrap: balance;
  }
  h1 { font-size: var(--fs-h1); }
  h2 { font-size: var(--fs-h2); }
  h3 { font-size: var(--fs-h3); line-height: 1.1; }
  h4 { font-size: var(--fs-h4); line-height: 1.2; }
  p  { text-wrap: pretty; }
  em { font-style: italic; }
  b, strong { font-weight: 600; }

  a:not([class]) {
    background:
      linear-gradient(var(--ink), var(--ink)) no-repeat 0 92% / 100% 1px;
    padding-bottom: 1px;
    transition: background-size var(--dur-1) var(--ease);
  }
  a:not([class]):hover {
    background-image: linear-gradient(var(--moss), var(--moss));
    color: var(--moss);
  }
}

/* ---------- Layout primitives ----------------------------- */
@layer layout {
  .wrap {
    width: min(100% - calc(var(--gutter) * 2), var(--max));
    margin-inline: auto;
  }

  .grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--gutter);
    row-gap: var(--s-7);
  }

  .stack > * + * { margin-block-start: var(--stack, var(--s-5)); }

  .lede { font-size: var(--fs-lead); color: var(--ink-soft); max-width: 36ch; }
  .lede.long { max-width: 56ch; }

  .overline {
    font-family: var(--sans);
    font-size: var(--fs-overline);
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--moss-deep);
    font-weight: 600;
  }

  .chapter-num {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(2rem, 1.4rem + 1.6vw, 3rem);
    color: color-mix(in oklab, var(--ink) 35%, transparent);
    line-height: 1;
  }

  section { padding-block: var(--s-10); }
  section + section { border-top: var(--hairline); }

  @media (max-width: 720px) {
    section { padding-block: var(--s-8); }
  }
}

/* ---------- Header + Footer ------------------------------- */
@layer components {
  .site-header {
    position: sticky; top: 0; z-index: 30;
    backdrop-filter: blur(10px) saturate(1.05);
    background: color-mix(in oklab, var(--paper) 78%, transparent);
    border-bottom: var(--hairline);
  }
  .site-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    padding-block: var(--s-4);
    gap: var(--s-5);
  }
  .brand {
    display: inline-flex;
    align-items: center;
    line-height: 0;
  }
  .brand__logo {
    height: 54px;
    width: auto;
    display: block;
    /* Logo PNG ships on a light background — multiply against the parchment header. */
    mix-blend-mode: multiply;
    transition: opacity var(--dur-1) var(--ease);
  }
  .brand:hover .brand__logo { opacity: .82; }
  @media (max-width: 520px) {
    .brand__logo { height: 44px; }
  }
  .nav { display: flex; gap: var(--s-6); align-items: center; font-size: .94rem; }
  .nav a {
    position: relative;
    padding-block: .25rem;
  }
  .nav a[aria-current="page"]::after,
  .nav a:hover::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
    height: 1px; background: var(--moss);
  }
  .nav__cta {
    border: var(--hairline-strong);
    padding: .55rem 1rem;
    border-radius: 999px;
    transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
  }
  .nav__cta:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .nav__cta:hover::after { display: none; }
  @media (max-width: 760px) {
    .nav { gap: var(--s-4); font-size: .88rem; }
    .nav__item--secondary { display: none; }
    .brand__tag { display: none; }
  }

  .site-footer {
    margin-top: var(--s-10);
    background: var(--ink);
    color: color-mix(in oklab, var(--paper) 86%, transparent);
    padding-block: var(--s-8) var(--s-6);
  }
  .site-footer a { color: color-mix(in oklab, var(--paper) 92%, transparent); }
  .site-footer a:hover { color: var(--paper); }
  .site-footer h4 {
    font-family: var(--sans);
    font-size: var(--fs-overline);
    text-transform: uppercase;
    letter-spacing: .22em;
    color: color-mix(in oklab, var(--paper) 70%, transparent);
    margin-bottom: var(--s-3);
  }
  .footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: var(--s-7);
  }
  @media (max-width: 880px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 520px) {
    .footer-grid { grid-template-columns: 1fr; gap: var(--s-5); }
  }
  .footer-mark {
    font-family: var(--serif);
    font-size: 2rem;
    line-height: 1;
    letter-spacing: .04em;
    color: var(--paper);
  }
  .footer-mark em {
    display: block;
    font-style: italic;
    font-size: .9rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: color-mix(in oklab, var(--paper) 55%, transparent);
    margin-top: var(--s-3);
  }
  .site-footer ul[role="list"] { display: grid; gap: .35rem; }
  .legalbar {
    margin-top: var(--s-7);
    padding-top: var(--s-5);
    border-top: 1px solid color-mix(in oklab, var(--paper) 18%, transparent);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--s-3);
    font-size: .82rem;
    color: color-mix(in oklab, var(--paper) 55%, transparent);
  }
  .legalbar nav { display: flex; gap: var(--s-5); }
}

/* ---------- Hero ----------------------------------------- */
@layer components {
  .hero {
    padding-top: var(--s-9);
    padding-bottom: var(--s-10);
    position: relative;
  }
  .hero__grid {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    column-gap: var(--gutter);
    align-items: end;
  }
  @media (max-width: 900px) {
    .hero__grid { grid-template-columns: 1fr; row-gap: var(--s-7); }
  }
  .hero__copy { padding-bottom: var(--s-4); }
  .hero__copy h1 {
    font-size: var(--fs-display);
    line-height: .92;
    letter-spacing: -.022em;
  }
  .hero__copy h1 em {
    font-style: italic;
    color: var(--moss-deep);
  }
  .hero__meta {
    margin-top: var(--s-7);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-5);
    max-width: 38rem;
    border-top: var(--hairline);
    padding-top: var(--s-5);
  }
  .hero__meta dt {
    font-size: var(--fs-overline);
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--moss-deep);
    margin-bottom: var(--s-2);
  }
  .hero__meta dd { font-family: var(--serif); font-size: 1.1rem; line-height: 1.3; }

  .hero__visual {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: 0 30px 60px -30px rgba(31,27,23,.35);
  }
  .hero__visual img {
    width: 100%; height: 100%; object-fit: cover;
    filter: saturate(.92) contrast(1.02);
  }
  .hero__caption {
    position: absolute; left: var(--s-4); bottom: var(--s-4);
    color: var(--paper);
    font-size: var(--fs-overline);
    letter-spacing: .22em;
    text-transform: uppercase;
    background: color-mix(in oklab, var(--ink) 55%, transparent);
    padding: .5rem .8rem;
    backdrop-filter: blur(6px);
    border-radius: 999px;
  }

  .hero__bar {
    margin-top: var(--s-9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
    padding-block: var(--s-4);
    border-top: var(--hairline);
    border-bottom: var(--hairline);
    font-size: var(--fs-meta);
    color: var(--ink-soft);
  }
  .hero__bar strong { color: var(--ink); font-weight: 600; }
  .hero__bar svg { display: inline-block; vertical-align: -.2em; }
}

/* ---------- Manifesto / editorial ------------------------- */
@layer components {
  .manifesto__grid {
    display: grid;
    grid-template-columns: 4fr 8fr;
    gap: var(--s-7);
  }
  @media (max-width: 800px) { .manifesto__grid { grid-template-columns: 1fr; } }
  .manifesto__body {
    font-family: var(--serif);
    font-size: clamp(1.3rem, 1.1rem + .8vw, 1.65rem);
    line-height: 1.45;
    color: var(--ink);
    max-width: 56ch;
  }
  .manifesto__body p + p { margin-top: 1em; }
  .manifesto__body .drop {
    font-size: 4.2em;
    line-height: .9;
    float: left;
    margin: .04em .14em -.05em 0;
    color: var(--moss-deep);
    font-style: italic;
  }
}

/* ---------- Projects chapters ----------------------------- */
@layer components {
  .chapters { display: grid; gap: var(--s-10); }
  .chapter {
    display: grid;
    grid-template-columns: 7fr 5fr;
    column-gap: var(--s-7);
    row-gap: var(--s-5);
    align-items: end;
  }
  .chapter:nth-of-type(even) { grid-template-columns: 5fr 7fr; }
  .chapter:nth-of-type(even) .chapter__media { order: -1; }
  @media (max-width: 880px) {
    .chapter, .chapter:nth-of-type(even) { grid-template-columns: 1fr; }
    .chapter:nth-of-type(even) .chapter__media { order: 0; }
  }
  .chapter__media {
    position: relative;
    aspect-ratio: 5/4;
    overflow: hidden;
    border-radius: var(--radius);
  }
  .chapter__media img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 1.2s var(--ease-out);
  }
  .chapter__media:hover img { transform: scale(1.03); }
  .chapter__copy { padding-block: var(--s-5); }
  .chapter__copy .chapter-num { display: block; margin-bottom: var(--s-3); }
  .chapter__copy h3 { margin-bottom: var(--s-3); }
  .chapter__meta {
    margin-top: var(--s-5);
    display: grid;
    grid-template-columns: auto auto auto;
    gap: var(--s-5);
    font-size: var(--fs-meta);
    color: var(--ink-soft);
    border-top: var(--hairline);
    padding-top: var(--s-4);
    width: max-content;
    max-width: 100%;
  }
  .chapter__meta dt {
    font-size: var(--fs-overline);
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--moss-deep);
    margin-bottom: .2rem;
  }
  .chapter__meta dd { font-family: var(--serif); }
  @media (max-width: 480px) {
    .chapter__meta { grid-template-columns: 1fr 1fr; }
  }
}

/* ---------- Services grid --------------------------------- */
@layer components {
  .services-head {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: var(--s-7);
    align-items: end;
    margin-bottom: var(--s-8);
  }
  @media (max-width: 800px) { .services-head { grid-template-columns: 1fr; } }

  .services {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0;
    border-top: var(--hairline-strong);
  }
  .service {
    grid-column: span 4;
    padding: var(--s-6) var(--s-5);
    border-right: var(--hairline);
    border-bottom: var(--hairline);
    display: flex; flex-direction: column; gap: var(--s-4);
    background: color-mix(in oklab, var(--paper) 92%, var(--sand));
    transition: background var(--dur-2) var(--ease);
    container-type: inline-size;
  }
  .service:nth-child(3n) { border-right: none; }
  .service:hover { background: color-mix(in oklab, var(--paper) 70%, var(--sand)); }
  .service__icon {
    width: 44px; height: 44px; color: var(--moss-deep);
    flex: none;
  }
  .service__title { font-size: 1.4rem; line-height: 1.15; }
  .service__desc { color: var(--ink-soft); font-size: .98rem; }
  .service__detail {
    margin-top: auto;
    padding-top: var(--s-4);
    border-top: var(--hairline);
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: var(--fs-meta);
    color: var(--ink-soft);
  }
  .service__detail b { color: var(--ink); font-family: var(--serif); font-weight: 400; }

  @media (max-width: 900px) {
    .service { grid-column: span 6; }
    .service:nth-child(3n) { border-right: var(--hairline); }
    .service:nth-child(2n) { border-right: none; }
  }
  @media (max-width: 560px) {
    .service { grid-column: span 12; border-right: none; }
  }
}

/* ---------- Process ribbon -------------------------------- */
@layer components {
  .process {
    background: var(--moss-deep);
    color: var(--paper);
    border-radius: 0;
    padding-block: var(--s-10);
    position: relative;
    overflow: hidden;
  }
  .process::after {
    content: "";
    position: absolute; inset: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='1' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: .8;
  }
  .process > * { position: relative; }
  .process h2 { color: var(--paper); }
  .process .overline { color: color-mix(in oklab, var(--paper) 72%, var(--moss)); }
  .process__head { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s-7); margin-bottom: var(--s-8); align-items: end; }
  .process__head p { color: color-mix(in oklab, var(--paper) 82%, transparent); max-width: 48ch; }
  @media (max-width: 800px) { .process__head { grid-template-columns: 1fr; } }
  .steps {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 1fr);
    gap: var(--s-5);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--s-5);
    scrollbar-width: thin;
    scrollbar-color: color-mix(in oklab, var(--paper) 30%, transparent) transparent;
  }
  .step {
    scroll-snap-align: start;
    border-top: 1px solid color-mix(in oklab, var(--paper) 30%, transparent);
    padding-top: var(--s-4);
    display: grid; gap: var(--s-3);
  }
  .step__num {
    font-family: var(--serif);
    font-style: italic;
    font-size: 2.2rem;
    color: color-mix(in oklab, var(--paper) 70%, transparent);
  }
  .step h4 { color: var(--paper); }
  .step p { color: color-mix(in oklab, var(--paper) 78%, transparent); font-size: .96rem; }
}

/* ---------- About / Portrait ------------------------------ */
@layer components {
  .about {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: var(--s-7);
    align-items: start;
  }
  @media (max-width: 880px) { .about { grid-template-columns: 1fr; } }
  .portrait {
    aspect-ratio: 4/5;
    overflow: hidden;
    border-radius: var(--radius);
  }
  .portrait img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.92); }
  .about__body { font-family: var(--serif); font-size: 1.2rem; line-height: 1.5; }
  .about__body p + p { margin-top: 1em; }
  .credentials {
    margin-top: var(--s-6);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--s-4);
    border-top: var(--hairline);
    padding-top: var(--s-5);
  }
  .credentials dt {
    font-family: var(--sans);
    font-size: var(--fs-overline);
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--moss-deep);
    margin-bottom: var(--s-1);
  }
  .credentials dd { font-family: var(--serif); font-size: 1rem; color: var(--ink); }
}

/* ---------- Pull quote / testimonial --------------------- */
@layer components {
  .pullquote {
    text-align: center;
    max-width: 30ch;
    margin-inline: auto;
  }
  .pullquote p {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.6rem, 1.2rem + 2vw, 2.6rem);
    line-height: 1.2;
    color: var(--ink);
  }
  .pullquote footer {
    margin-top: var(--s-5);
    font-size: var(--fs-meta);
    color: var(--ink-soft);
    letter-spacing: .12em;
    text-transform: uppercase;
  }
  .pullquote::before,
  .pullquote::after {
    content: "";
    display: block;
    width: 36px; height: 1px;
    background: var(--ink-soft);
    margin: var(--s-5) auto;
  }
}

/* ---------- Contact CTA ---------------------------------- */
@layer components {
  .cta {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: var(--s-7);
    align-items: end;
    padding-block: var(--s-9);
    border-top: var(--hairline-strong);
    border-bottom: var(--hairline-strong);
  }
  @media (max-width: 800px) { .cta { grid-template-columns: 1fr; } }
  .cta h2 em { font-style: italic; color: var(--moss-deep); }
  .cta__meta { display: grid; gap: var(--s-4); }
  .cta__meta a.btn { justify-self: start; }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    padding: .9rem 1.3rem;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    font-size: .94rem;
    letter-spacing: .04em;
    border-radius: 999px;
    transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
  }
  .btn:hover { transform: translateY(-1px); background: var(--moss-deep); border-color: var(--moss-deep); }
  .btn--ghost { background: transparent; color: var(--ink); }
  .btn--ghost:hover { background: var(--ink); color: var(--paper); }
  .btn svg { transition: transform var(--dur-1) var(--ease); }
  .btn:hover svg { transform: translateX(3px); }
}

/* ---------- Marquee of credentials ------------------------ */
@layer components {
  .marquee {
    overflow: hidden;
    border-top: var(--hairline);
    border-bottom: var(--hairline);
    padding-block: var(--s-5);
    mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  }
  .marquee__track {
    display: flex;
    gap: var(--s-8);
    width: max-content;
    animation: scroll 38s linear infinite;
    align-items: center;
    color: var(--ink-soft);
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.1rem;
    letter-spacing: .06em;
  }
  .marquee__track span { display: inline-flex; align-items: center; gap: var(--s-4); white-space: nowrap; }
  .marquee__track i {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--moss);
  }
  @keyframes scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }
}

/* ---------- Reusable page-head ---------------------------- */
@layer components {
  .page-head {
    padding-block: var(--s-10) var(--s-7);
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: var(--s-7);
    align-items: end;
  }
  @media (max-width: 800px) { .page-head { grid-template-columns: 1fr; padding-block: var(--s-8) var(--s-6); } }
  .page-head h1 {
    font-size: clamp(2.4rem, 1.6rem + 4vw, 4.6rem);
    line-height: 1;
  }
  .page-head h1 em { color: var(--moss-deep); font-style: italic; }

  .breadcrumb {
    font-size: var(--fs-overline);
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--moss-deep);
    margin-bottom: var(--s-4);
  }
}

/* ---------- Leistungen page detail rows ------------------- */
@layer components {
  .leistung {
    display: grid;
    grid-template-columns: 1fr 6fr 5fr;
    gap: var(--s-6);
    padding-block: var(--s-7);
    border-top: var(--hairline);
    align-items: start;
  }
  .leistung:last-child { border-bottom: var(--hairline); }
  .leistung__num {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.8rem;
    color: var(--moss-deep);
  }
  .leistung__title h3 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); }
  .leistung__title p { color: var(--ink-soft); margin-top: var(--s-3); max-width: 40ch; }
  .leistung__body ul[role="list"] {
    display: grid; gap: var(--s-3);
  }
  .leistung__body li {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: .8rem;
    align-items: start;
    color: var(--ink-soft);
    line-height: 1.5;
  }
  .leistung__body li::before {
    content: "";
    margin-top: .7em;
    width: 8px; height: 1px;
    background: var(--moss);
  }
  .leistung__body li > * { grid-column: 2; }
  @media (max-width: 780px) {
    .leistung { grid-template-columns: 1fr; gap: var(--s-4); }
  }
}

/* ---------- Kontakt page --------------------------------- */
@layer components {
  .kontakt-grid {
    display: grid;
    grid-template-columns: 6fr 6fr;
    gap: var(--s-8);
    align-items: start;
  }
  @media (max-width: 860px) { .kontakt-grid { grid-template-columns: 1fr; } }
  .info-card {
    border: var(--hairline);
    padding: var(--s-6);
    background: color-mix(in oklab, var(--paper) 88%, var(--sand));
    display: grid;
    gap: var(--s-5);
  }
  .info-card h3 { font-size: 1.4rem; }
  .info-card .row {
    display: grid; grid-template-columns: 120px 1fr;
    gap: var(--s-3);
    border-top: var(--hairline);
    padding-top: var(--s-3);
  }
  .info-card .row:first-of-type { border-top: none; padding-top: 0; }
  .info-card .row dt {
    font-size: var(--fs-overline);
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--moss-deep);
  }
  .info-card .row dd { font-family: var(--serif); font-size: 1.05rem; }

  .map-placeholder {
    aspect-ratio: 5/4;
    background:
      radial-gradient(circle at 30% 40%, color-mix(in oklab, var(--moss) 70%, transparent), transparent 45%),
      radial-gradient(circle at 70% 60%, color-mix(in oklab, var(--patina) 60%, transparent), transparent 50%),
      repeating-linear-gradient(45deg, transparent 0 14px, color-mix(in oklab, var(--moss) 14%, transparent) 14px 15px),
      var(--paper-2);
    border: var(--hairline);
    position: relative;
    overflow: hidden;
  }
  .map-pin {
    position: absolute; left: 50%; top: 46%;
    width: 14px; height: 14px;
    transform: translate(-50%, -50%);
    background: var(--rust);
    border: 3px solid var(--paper);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--rust), 0 10px 24px -8px rgba(31,27,23,.4);
  }
  .map-pin::after {
    content: attr(data-label);
    position: absolute; left: 22px; top: -8px;
    background: var(--ink);
    color: var(--paper);
    padding: .35rem .7rem;
    font-family: var(--sans);
    font-size: .72rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    white-space: nowrap;
    border-radius: 999px;
  }
}

/* ---------- Legal pages ---------------------------------- */
@layer components {
  .legal {
    max-width: 70ch;
    margin-inline: auto;
    padding-block: var(--s-9) var(--s-10);
    font-size: 1rem;
    color: var(--ink-soft);
    line-height: 1.7;
  }
  .legal h1 { margin-bottom: var(--s-5); }
  .legal h2 {
    margin-top: var(--s-7);
    margin-bottom: var(--s-3);
    font-size: clamp(1.3rem, 1.1rem + .6vw, 1.7rem);
    color: var(--ink);
  }
  .legal h3 {
    margin-top: var(--s-5);
    margin-bottom: var(--s-2);
    font-size: 1.15rem;
    color: var(--ink);
  }
  .legal p + p, .legal ul + p, .legal p + ul { margin-top: var(--s-4); }
  .legal ul { padding-left: 1.2rem; }
  .legal ul li { margin-bottom: .3rem; }
  .legal a { color: var(--moss-deep); text-decoration: underline; text-underline-offset: 3px; }
}

/* ---------- Motion (scroll-driven reveals) ---------------- */
@layer motion {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    animation: rise both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }
  .reveal--late { animation-range: entry 10% cover 40%; }
  @keyframes rise {
    to { opacity: 1; transform: translateY(0); }
  }

  .glide {
    clip-path: inset(8% 8% 8% 8%);
    animation: open both;
    animation-timeline: view();
    animation-range: entry 0% cover 50%;
  }
  @keyframes open {
    to { clip-path: inset(0 0 0 0); }
  }

  /* Fallback for browsers without animation-timeline */
  @supports not (animation-timeline: view()) {
    .reveal, .glide { opacity: 1; transform: none; clip-path: none; animation: none; }
  }
}

/* ---------- Utilities ----------------------------------- */
@layer utilities {
  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
  }
  .text-balance { text-wrap: balance; }
  .max-prose { max-width: var(--measure); }
}
