/* ==========================================================================
   Manodent — main.css
   One stylesheet for every page and language (/en/, /de/, /bg/).
   Order: 1 tokens · 2 fonts · 3 base · 4 layout · 5 components · 6 motion
   ========================================================================== */


/* 1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Colour — sampled from the Manodent logo files */
  --color-navy: #02315a;          /* logo navy: logo, headlines, focus rings */
  --color-navy-deep: #012340;     /* pressed / hover states */
  --color-heading: var(--color-navy); /* headlines and large text: logo navy (13:1 on white) */
  --color-steel: #8fb1c3;         /* logo steel variant */
  --color-steel-tint: #dde8ed;    /* steel at 30% on white */
  --color-ink: #1e2226;           /* body text, near-black grey (16:1 on white) */
  --color-ink-muted: #4b5258;     /* secondary text (7.9:1 on white) */
  --color-ink-subtle: #5f6d79;    /* quiet labels, inactive list items (5.3:1 on white) */
  --color-line: #e4e8ec;          /* hairlines, dividers */
  --color-mist: #f4f6f8;          /* quiet section background */
  --color-night: #011a31;         /* deep navy ground for dark stages (contact) */
  --color-white: #ffffff;

  /* On dark stages */
  --on-dark: var(--color-white);
  --on-dark-muted: rgb(255 255 255 / 0.76);   /* body text (≥ 6:1 on glass) */
  --on-dark-subtle: rgb(255 255 255 / 0.64);  /* labels, notes (≥ 4.6:1 on glass) */
  --on-dark-line: rgb(255 255 255 / 0.14);
  --on-dark-error: #ffb6a8;
  --color-bg: var(--color-white);
  --color-focus: var(--color-navy);

  /* Typography */
  --font-heading: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --font-body: "Anuphan", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;

  --text-xs: 0.8125rem;                                   /* 13 */
  --text-sm: 0.9375rem;                                   /* 15 */
  --text-base: 1.0625rem;                                 /* 17 */
  --text-lead: clamp(1.0625rem, 0.99rem + 0.36vw, 1.3125rem);  /* 17 → 21 */
  --text-h3: clamp(1.25rem, 1.12rem + 0.6vw, 1.625rem);   /* 20 → 26 */
  --text-h2: clamp(1.625rem, 1.3rem + 1.3vw, 2.5rem);     /* 26 → 40 */
  --text-h1: clamp(2rem, 1.55rem + 1.9vw, 3.25rem);       /* 32 → 52: titles of text pages */
  /* 27 → 58 (27 at 390, 52 at 1440), also capped by viewport height so landscape phones fit */
  --text-display: clamp(1.6875rem, min(0.86rem + 2.64vw, 0.4rem + 5.28vh), 3.625rem);

  --leading-display: 1.06;
  --leading-heading: 1.18;
  --leading-body: 1.55;
  --tracking-display: -0.02em;
  --tracking-heading: -0.012em;

  /* Spacing — 4px base */
  --space-1: 0.25rem;   /* 4 */
  --space-2: 0.5rem;    /* 8 */
  --space-3: 0.75rem;   /* 12 */
  --space-4: 1rem;      /* 16 */
  --space-5: 1.5rem;    /* 24 */
  --space-6: 2rem;      /* 32 */
  --space-7: 3rem;      /* 48 */
  --space-8: 4rem;      /* 64 */
  --space-9: 6rem;      /* 96 */
  --space-10: 8rem;     /* 128 */

  --gutter: clamp(1.25rem, 0.55rem + 3vw, 4rem);          /* page side margin 20 → 64 */
  --container: 90rem;                                     /* 1440 content width */

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-button: 8px;           /* rectangular buttons, softly cornered */
  --radius-pill: 999px;

  /* Header: a white bar (see Site header). --header-h is the whole header
     zone: the bar plus, from 37.5em, its distance from the top */
  --header-bar-h: clamp(4rem, 3.6rem + 1vw, 4.5rem);                        /* 64 → 72 */
  --header-float: 0px;
  --header-h: calc(var(--header-float) + var(--header-bar-h));
  --logo-h: clamp(1.625rem, min(1.45rem + 0.6vw, 1rem + 2.4vh), 2.125rem);  /* 26 → 34 */

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 160ms;
  --dur-base: 320ms;
  --dur-slow: 900ms;
}

/* Small-viewport units keep mobile browser toolbars out of the sum */
@supports (height: 1svh) {
  :root {
    --text-display: clamp(1.6875rem, min(0.86rem + 2.64vw, 0.4rem + 5.28svh), 3.625rem);
    --logo-h: clamp(1.625rem, min(1.45rem + 0.6vw, 1rem + 2.4svh), 2.125rem);
  }
}

@media (min-width: 37.5em) {
  :root {
    --header-float: clamp(0.75rem, 0.5rem + 0.6vw, 1rem);                  /* 12 → 16 */
  }
}


/* 2. Fonts — self-hosted, SIL Open Font License (see assets/fonts/OFL-*.txt)
   Headings: Cormorant Garamond 500 (Latin + Cyrillic, ready for /bg/).
   Body: Anuphan. It has no Cyrillic, so /bg/ needs a Cyrillic-capable body face.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-500-latin-ext.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-500-cyrillic.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-500-cyrillic-ext.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Anuphan";
  src: url("../fonts/anuphan-latin.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Anuphan";
  src: url("../fonts/anuphan-latin-ext.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


/* 3. Base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--color-heading);
  overflow-wrap: break-word;
}

:lang(de) :is(h1, h2, h3, h4) {
  hyphens: auto;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
  border-radius: 2px;
}

::selection {
  background: var(--color-steel-tint);
  color: var(--color-heading);
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}


/* 4. Layout
   -------------------------------------------------------------------------- */

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}


/* 5. Components
   -------------------------------------------------------------------------- */

/* Skip link */
.skip-link {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-navy);
  color: var(--color-white);
  font-size: var(--text-sm);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
  outline-color: var(--color-white);
  outline-offset: -4px;
}

/* Site header — a white bar that keeps the navy logo clear of whatever is
   behind it. Phones: full width, rounded only at the bottom (10px), sticky.
   From 37.5em: a floating bar with 12px corners, trimmed to just outside the
   logo (the logo keeps the content's left edge); it scrolls away with the
   page. --overlay lets a full-bleed hero run under it. Navigation will sit in
   .site-header__inner, on the right. */
.site-header {
  --header-bar-pad: clamp(1rem, 0.6rem + 1vw, 1.5rem);   /* bar edge to logo, 16 → 24 */

  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header--overlay {
  position: fixed;
  inset: 0 0 auto;
}

.site-header__bar {
  border-radius: 0 0 10px 10px;
  background: var(--color-white);
  box-shadow:
    0 1px 2px rgb(2 49 90 / 0.06),
    0 0.5rem 1.5rem -0.5rem rgb(2 49 90 / 0.2);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--header-bar-h);
}

@media (min-width: 37.5em) {
  .site-header {
    position: relative;
    padding-top: var(--header-float);
  }

  .site-header--overlay {
    position: absolute;
  }

  .site-header__bar {
    width: min(100% - 2 * max(var(--gutter) - var(--header-bar-pad), 0.75rem), var(--container) + 2 * var(--header-bar-pad));
    margin-inline: auto;
    border-radius: 12px;
    box-shadow:
      0 0 0 1px rgb(2 49 90 / 0.05),
      0 1px 2px rgb(2 49 90 / 0.05),
      0 0.75rem 2rem -0.75rem rgb(2 49 90 / 0.22);
  }

  .site-header__inner {
    width: auto;
    padding-inline: var(--header-bar-pad);
  }
}

/* phones: links within the page land below the sticky bar */
@media (max-width: 37.4375em) {
  html {
    scroll-padding-top: var(--header-bar-h);
  }
}

@media (prefers-contrast: more) {
  .site-header__bar {
    box-shadow: inset 0 0 0 1px var(--color-ink-subtle);
  }
}

@media (forced-colors: active) {
  .site-header__bar {
    border: 1px solid CanvasText;
  }
}

/* Brand lockup: MD mark + MANODENT wordmark (inline SVG, colour via currentColor) */
.brand {
  display: inline-flex;
  align-items: center;
  /* comfortable touch target around a 26–34px logo */
  min-height: 44px;
  color: var(--color-navy);
  text-decoration: none;
}

.brand__logo {
  height: var(--logo-h);
  width: auto;
  aspect-ratio: 691.3 / 100;
}

/* Hero
   Mobile first: the photo fills the top of the screen and dissolves into
   white; the copy sits at the bottom on white (Griffin-style empty space).
   Landscape screens: the photo anchors right and dissolves into white at the
   top, left and bottom; the copy and its "Get in touch" button stay
   bottom-left. */
.hero {
  --hero-fade-overlap: clamp(3rem, 2rem + 4vw, 5rem);

  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(16rem, 1fr) auto;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.hero__media {
  position: relative;
  z-index: -1;
  grid-row: 1;
  grid-column: 1;
  /* run the photo a little under the copy so the fade finishes behind it */
  margin-bottom: calc(-1 * var(--hero-fade-overlap));
}

.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* the portrait photo: on short screens crop the blurred lab at the top
     (under the header), not the implants; on narrow ones keep the left
     implant whole */
  object-position: 30% 85%;
  /* eased fade (smoothstep) to avoid a visible band where it ends; it starts
     halfway, so the implants and the granules stay clear */
  -webkit-mask-image: linear-gradient(to bottom,
    #000 0%, #000 50%,
    rgb(0 0 0 / 0.972) 55%, rgb(0 0 0 / 0.896) 60%, rgb(0 0 0 / 0.784) 65%,
    rgb(0 0 0 / 0.648) 70%, rgb(0 0 0 / 0.5) 75%, rgb(0 0 0 / 0.352) 80%,
    rgb(0 0 0 / 0.216) 85%, rgb(0 0 0 / 0.104) 90%, rgb(0 0 0 / 0.028) 95%,
    transparent 100%);
  mask-image: linear-gradient(to bottom,
    #000 0%, #000 50%,
    rgb(0 0 0 / 0.972) 55%, rgb(0 0 0 / 0.896) 60%, rgb(0 0 0 / 0.784) 65%,
    rgb(0 0 0 / 0.648) 70%, rgb(0 0 0 / 0.5) 75%, rgb(0 0 0 / 0.352) 80%,
    rgb(0 0 0 / 0.216) 85%, rgb(0 0 0 / 0.104) 90%, rgb(0 0 0 / 0.028) 95%,
    transparent 100%);
}

.hero__content {
  grid-row: 2;
  grid-column: 1;
  padding-block: var(--space-5) calc(var(--space-7) + env(safe-area-inset-bottom, 0px));
}

.hero__copy {
  max-width: 44rem;
}

/* "Your trusted partner for" is always its own line; the rest follows on one
   line on wide screens and wraps once on phones */
.hero__title {
  font-size: var(--text-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.hero__title-rest {
  display: block;
}

.hero__lead {
  max-width: 30em;
  margin-top: clamp(0.75rem, 0.62rem + 0.5vw, 1.125rem);
  font-size: var(--text-lead);
  font-weight: 300;
  line-height: 1.5;
  color: var(--color-ink);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: clamp(1.5rem, 1.25rem + 1vw, 2.25rem);         /* 24 → 36 */
}

.hero__cta {
  min-height: 3rem;
  padding: 0.75rem 1.875rem;
  font-size: 1rem;
}

/* Landscape screens (tablets on their side, laptops, desktops) */
@media (min-width: 37.5em) and (min-aspect-ratio: 1/1) {
  .hero {
    grid-template-rows: minmax(var(--header-h), 1fr) auto;
  }

  .hero__media {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(60%, 64rem);
    margin: 0;
  }

  /* the portrait photo here (frames narrower than about square) */
  .hero__media img {
    object-position: 50% 60%;
    /* dissolve into white on the left (toward the copy), at the bottom, and
       softly at the top, which hides the dark back-counter strip in the photo */
    -webkit-mask-image:
      linear-gradient(to right,
        transparent 0%, rgb(0 0 0 / 0.028) 3%, rgb(0 0 0 / 0.104) 6%, rgb(0 0 0 / 0.216) 9%,
        rgb(0 0 0 / 0.352) 12%, rgb(0 0 0 / 0.5) 15%, rgb(0 0 0 / 0.648) 18%,
        rgb(0 0 0 / 0.784) 21%, rgb(0 0 0 / 0.896) 24%, rgb(0 0 0 / 0.972) 27%, #000 30%),
      linear-gradient(to bottom,
        transparent 0%, rgb(0 0 0 / 0.028) 1.6%, rgb(0 0 0 / 0.104) 3.2%, rgb(0 0 0 / 0.216) 4.8%,
        rgb(0 0 0 / 0.352) 6.4%, rgb(0 0 0 / 0.5) 8%, rgb(0 0 0 / 0.648) 9.6%,
        rgb(0 0 0 / 0.784) 11.2%, rgb(0 0 0 / 0.896) 12.8%, rgb(0 0 0 / 0.972) 14.4%, #000 16%,
        #000 52%,
        rgb(0 0 0 / 0.972) 56.8%, rgb(0 0 0 / 0.896) 61.6%, rgb(0 0 0 / 0.784) 66.4%,
        rgb(0 0 0 / 0.648) 71.2%, rgb(0 0 0 / 0.5) 76%, rgb(0 0 0 / 0.352) 80.8%,
        rgb(0 0 0 / 0.216) 85.6%, rgb(0 0 0 / 0.104) 90.4%, rgb(0 0 0 / 0.028) 95.2%,
        transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(to right,
        transparent 0%, rgb(0 0 0 / 0.028) 3%, rgb(0 0 0 / 0.104) 6%, rgb(0 0 0 / 0.216) 9%,
        rgb(0 0 0 / 0.352) 12%, rgb(0 0 0 / 0.5) 15%, rgb(0 0 0 / 0.648) 18%,
        rgb(0 0 0 / 0.784) 21%, rgb(0 0 0 / 0.896) 24%, rgb(0 0 0 / 0.972) 27%, #000 30%),
      linear-gradient(to bottom,
        transparent 0%, rgb(0 0 0 / 0.028) 1.6%, rgb(0 0 0 / 0.104) 3.2%, rgb(0 0 0 / 0.216) 4.8%,
        rgb(0 0 0 / 0.352) 6.4%, rgb(0 0 0 / 0.5) 8%, rgb(0 0 0 / 0.648) 9.6%,
        rgb(0 0 0 / 0.784) 11.2%, rgb(0 0 0 / 0.896) 12.8%, rgb(0 0 0 / 0.972) 14.4%, #000 16%,
        #000 52%,
        rgb(0 0 0 / 0.972) 56.8%, rgb(0 0 0 / 0.896) 61.6%, rgb(0 0 0 / 0.784) 66.4%,
        rgb(0 0 0 / 0.648) 71.2%, rgb(0 0 0 / 0.5) 76%, rgb(0 0 0 / 0.352) 80.8%,
        rgb(0 0 0 / 0.216) 85.6%, rgb(0 0 0 / 0.104) 90.4%, rgb(0 0 0 / 0.028) 95.2%,
        transparent 100%);
    mask-composite: intersect;
  }

  .hero__content {
    padding-block: var(--space-6) clamp(2rem, min(1.5rem + 4vw, 9vh), 6rem);
  }

  /* wide enough for the title's second line; the photo is faded out at the
     bottom where the copy sits */
  .hero__copy {
    max-width: 60vw;
  }

  /* the square photo (3:2 and wider, up to 1140px tall: the same media
     query as its <source> in the page) */
  @media (min-aspect-ratio: 3/2) and (max-height: 71.25em) {
    .hero__media img {
      object-position: 50% 30%;
    }
  }

  /* landscape phones: the copy fills most of the height, so the photo
     narrows, keeping the dark implants out from under the text */
  @media (max-height: 30em) {
    .hero__media {
      width: 52%;
    }

    .hero__media img {
      object-position: 50% 45%;
    }
  }
}

/* Inline SVG sprite: icons are drawn once and referenced with <use> */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Button — pill by default (the form's "Send message"); --smoke is the
   rectangular liquid-glass style used on light grounds */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 44px;
  padding: 0.5rem 1.125rem 0.5rem 1.375rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:focus-visible {
  border-radius: var(--radius-pill);
}

/* --smoke: liquid glass in deep graphite with white text, for actions on
   light grounds ("Get in touch", "Learn more", back to top). Text only,
   rectangular with soft corners. Quiet on purpose: an even tint (dark, not
   black), a white hairline rim and a faint light on the top edge; with a
   mouse the rim brightens where the pointer is (data-glass, main.js).
   Hover only deepens the tint a touch. Solid fallbacks below. */
.button--smoke {
  --smoke-tint: rgb(26 28 31 / 0.9);

  position: relative;
  isolation: isolate;
  padding-inline: 1.5rem;
  border: 0;
  border-radius: var(--radius-button);
  background-color: var(--smoke-tint);
  background-image: linear-gradient(180deg, rgb(255 255 255 / 0.06), rgb(255 255 255 / 0) 55%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.14),             /* hairline rim */
    inset 0 1px 0 rgb(255 255 255 / 0.1),                /* top edge catching the light */
    0 1px 2px rgb(10 12 14 / 0.16),
    0 0.625rem 1.5rem -0.75rem rgb(10 12 14 / 0.4);
  color: var(--color-white);
  font-weight: 450;
  letter-spacing: 0.01em;
}

.button--smoke::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(7rem 4rem at var(--glass-x) var(--glass-y), rgb(255 255 255 / 0.32), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

.button--smoke:hover {
  --smoke-tint: rgb(20 22 24 / 0.92);
}

.button--smoke:active {
  --smoke-tint: rgb(16 17 19 / 0.94);
}

.button--smoke:focus-visible {
  border-radius: var(--radius-button);
}

/* --icon: a square button holding only an icon (with a visually hidden label) */
.button--icon {
  width: 3rem;
  min-height: 3rem;
  padding: 0;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .button--smoke { --smoke-tint: rgb(36 38 41 / 0.97); }
}

@media (prefers-reduced-transparency: reduce) {
  .button--smoke {
    --smoke-tint: #2a2c2f;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  .button--smoke {
    --smoke-tint: #1e2226;
    box-shadow: none;
  }
}

@media (forced-colors: active) {
  .button--smoke {
    border: 1px solid ButtonText;
  }
}

.button__icon {
  flex: none;
  width: 1rem;
  height: 1rem;
}

/* --light: the primary action on dark stages */
.button--light {
  border-color: var(--color-white);
  background-color: var(--color-white);
  color: var(--color-navy);
  box-shadow: inset 0 -1px 0 rgb(2 49 90 / 0.12), 0 0.75rem 1.5rem -0.75rem rgb(0 8 20 / 0.7);
}

.button--light:hover {
  border-color: var(--color-steel-tint);
  background-color: var(--color-steel-tint);
}

/* --glass: a quiet secondary action on dark stages (add .glass .glass--clear) */
.button--glass {
  border: 0;
  color: var(--on-dark);
}

/* Services
   The four services as an accordion (one open at a time), each with a
   document illustration on its own background.
   Mobile first: the open service shows its document under the text.
   64em+: the open service's document sits in a rounded frame in the left half
   of the container, top-aligned with the heading, crossfading on change; the
   list takes the right half. The frame stays clear of the section edges so the
   hero above can fade out into white space.
   Each service is a <details>, so it opens and closes without JavaScript too
   (one at a time where the `name` attribute is supported); main.js animates
   the change and keeps one service open. */
.services {
  --service-gap: clamp(0.875rem, 0.75rem + 0.5vw, 1.25rem);  /* number → name: 14 → 20 */
  --service-indent: calc(1.5rem + var(--service-gap));       /* text lines up with the name */
  --services-pad: clamp(4.5rem, 2.6rem + 6vw, 8rem);         /* 72 → 128 */

  position: relative;
  padding-block: var(--services-pad);
}

.services__title {
  max-width: 11em;
  font-size: var(--text-h2);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.services__list {
  margin-top: clamp(2rem, 1.4rem + 2.4vw, 3.5rem);           /* 32 → 56 */
  border-bottom: 1px solid var(--color-line);
}

/* Service — one accordion item: <details> with the heading in its <summary>.
   Open = [open], except while main.js folds it away (.is-closing). */
.service {
  border-top: 1px solid var(--color-line);
}

.service__trigger {
  display: block;
  padding: clamp(1.125rem, 0.95rem + 0.45vw, 1.375rem) 0;    /* 18 → 22 */
  color: var(--color-ink-subtle);
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.service__trigger::-webkit-details-marker {
  display: none;
}

.service__trigger:hover,
.service[open]:not(.is-closing) .service__trigger {
  color: var(--color-heading);
}

.service__heading {
  display: flex;
  align-items: baseline;
  gap: var(--service-gap);
  color: inherit;
  font-family: inherit;
  font-size: 1rem;
}

.service__num {
  flex: none;
  width: 1.5rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.service__name {
  font-family: var(--font-heading);
  font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.75rem);       /* 22 → 28 */
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.service[open]:not(.is-closing) .service__name {
  font-size: clamp(1.625rem, 1.15rem + 1.5vw, 2.25rem);      /* 26 → 36 */
}

/* The panel collapses by animating its grid row between 0fr and 1fr */
.service__panel {
  display: grid;
  grid-template-rows: 1fr;
}

.service__clip {
  min-height: 0;
  overflow: hidden;
}

.service__body {
  padding-inline-start: var(--service-indent);
}

.service__text {
  max-width: 30em;
  color: var(--color-ink-muted);
  font-size: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);       /* 16 → 17 */
  line-height: 1.6;
  text-wrap: pretty;
}

.service__link {
  margin-top: clamp(1.125rem, 1rem + 0.4vw, 1.375rem);
}

/* folding away (main.js): the panel closes and its content fades out */
.service.is-closing .service__panel {
  grid-template-rows: 0fr;
  visibility: hidden;
}

.service.is-closing .service__body,
.service.is-closing .service-visual {
  opacity: 0;
}

/* Service visual — background image with the document centred on it.
   It is a size container, so the document scales with it. */
.service-visual {
  --doc-accent: var(--color-navy);

  position: relative;
  container-type: size;
  display: grid;
  place-items: center;
  aspect-ratio: 35 / 48;
  margin-block: clamp(1.5rem, 1.25rem + 1vw, 2rem) clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  overflow: hidden;
  border-radius: clamp(0.75rem, 0.6rem + 0.5vw, 0.875rem);
  background-color: var(--visual-ground, #061219);
}

.service-visual > * {
  grid-area: 1 / 1;
}

/* accent and fallback ground per service, taken from each background */
.service-visual--consultation {
  --doc-accent: #17804a;
  --visual-ground: #03140b;
}

.service-visual--implants {
  --doc-accent: #1e5fae;
  --visual-ground: #020b1c;
  --visual-focus: 55% 50%;
}

.service-visual--workflow {
  --doc-accent: #0b7a80;
  --visual-ground: #021416;
}

.service-visual--assistance {
  --doc-accent: #08718c;
  --visual-ground: #010b0e;
  --visual-focus: 78% 50%;   /* keep the bright streak in frame */
}

.service-visual__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--visual-focus, 50% 50%);
}

/* Document illustration. Sized in em so it scales as one piece:
   at 16px it is 400px wide; the panel's width and height cap it. */
.doc {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 25em;
  height: 37.75em;
  padding: 1.625em 1.75em;
  border-radius: 0.875em;
  background: var(--color-white);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.5) inset,
    0 3em 5.5em -1.75em rgb(0 0 0 / 0.65),
    0 1.125em 2.25em -1.125em rgb(0 0 0 / 0.45);
  color: var(--doc-accent);
  font-size: 0.75rem;
  font-size: calc(min(25rem, 84cqw, 62cqh) / 25);
  line-height: 1.4;
}

.service.is-closing .doc {
  opacity: 0;
  transform: translateY(1.25em) scale(0.985);
}

.doc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.875em;
  border-bottom: 1px solid var(--color-line);
}

.doc__logo {
  width: auto;
  height: 0.75em;
}

.doc__partner {
  width: auto;
  height: 0.9375em;
}

.doc__no {
  color: var(--color-ink-subtle);
  font-size: 0.6875em;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.doc__title {
  margin-top: 0.6em;
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 1.875em;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.doc__figure {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 1em;
  border-radius: 0.625em;
  /* a faint drafting grid under the technical drawings */
  background-color: var(--color-mist);
  background-image:
    linear-gradient(rgb(2 49 90 / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(2 49 90 / 0.045) 1px, transparent 1px);
  background-size: 0.75em 0.75em;
  background-position: center;
}

.doc__art {
  position: absolute;
  inset: 0.75em;
  width: calc(100% - 1.5em);
  height: calc(100% - 1.5em);
  object-fit: contain;
}

/* the steps close on a hairline, mirroring the one under the letterhead */
.doc__steps {
  margin: 0.75em 0 0;
  padding: 0 0 0.875em;
  border-bottom: 1px solid var(--color-line);
  list-style: none;
}

.doc__step {
  display: flex;
  align-items: center;
  gap: 0.625em;
  height: 2.25em;
}

.doc__steps--compact .doc__step {
  height: 1.75em;
}

.doc__status {
  flex: none;
  width: 1.0625em;
  height: 1.0625em;
}

.doc__label {
  color: var(--color-ink);
  font-size: 0.875em;
  font-weight: 500;
  white-space: nowrap;
}

.doc__leader {
  flex: 1 1 auto;
  height: 0.125em;
  margin-top: 0.3em;
  background: radial-gradient(circle, #b4c0c9 0.045em, transparent 0.06em) 0 0 / 0.3125em 0.125em repeat-x;
}

.doc__meta {
  color: var(--color-ink-subtle);
  font-size: 0.75em;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.doc__code {
  min-width: 2.6em;
  padding: 0.1em 0.45em;
  border: 1px solid currentColor;
  border-radius: 0.35em;
  font-size: 0.6875em;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-align: center;
}

@media (min-width: 37.5em) {
  .service-visual {
    aspect-ratio: 6 / 5;
    max-height: min(85vh, 44rem);   /* landscape phones */
  }
}

/* Wide screens: framed document left, list right */
@media (min-width: 64em) {
  .services {
    min-height: calc(44rem + 2 * var(--services-pad));       /* room for a full-size document */
  }

  .services__content {
    width: calc(50% - clamp(3rem, 6vw, 6rem));
    margin-inline-start: auto;
  }

  .service__body {
    padding-bottom: 2rem;
  }

  /* the section is the containing block, so the visual escapes the panel's
     clip; its left edge is the container's left edge */
  .service-visual {
    position: absolute;
    inset: var(--services-pad) 50% var(--services-pad) max(var(--gutter), calc((100% - var(--container)) / 2));
    max-height: none;
    margin: 0;
    border-radius: 20px;
    aspect-ratio: auto;
  }

  .service[open]:not(.is-closing) .service-visual {
    z-index: 1;
  }
}

/* Site footer — the same on every page: logo, links and a back-to-top
   control (a plain #top link, so it needs no script), then the copyright
   line. On white; on the home page it follows the contact stage. */
.site-footer {
  padding-block: clamp(2.5rem, 2rem + 2vw, 3.5rem) calc(clamp(1.5rem, 1.2rem + 1vw, 2rem) + env(safe-area-inset-bottom, 0px));
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand up"
    "nav   nav";
  align-items: center;
  gap: 1rem 2rem;
}

.site-footer__brand {
  grid-area: brand;
  display: grid;
  gap: 0.625rem;
}

.site-footer__nav {
  grid-area: nav;
}

.site-footer__up {
  grid-area: up;
}

@media (min-width: 37.5em) {
  .site-footer__top {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "brand nav up";
    column-gap: clamp(1.5rem, 0.9rem + 2vw, 2.5rem);
  }
}

.site-footer__home {
  justify-self: start;
  display: inline-flex;
  min-height: 24px;
  align-items: center;
}

.site-footer__logo {
  width: auto;
  height: 1.25rem;
}

.site-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  column-gap: clamp(1.25rem, 0.8rem + 1.6vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* padding keeps each link a comfortable tap target */
.site-footer__nav a {
  display: inline-block;
  padding-block: 0.625rem;
  color: var(--color-navy);
  font-weight: 500;
  text-decoration: none;
}

.site-footer__nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  margin-top: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  padding-top: clamp(1.25rem, 1rem + 1vw, 1.5rem);
  border-top: 1px solid var(--color-line);
  color: var(--color-ink-subtle);
  font-size: var(--text-xs);
}

/* Text page — the privacy policy and other plain pages: one readable column,
   aligned with the logo, in the site's type */
.text-page {
  padding-block: clamp(1.5rem, 0.5rem + 4vw, 4rem) clamp(4rem, 2.5rem + 5vw, 7rem);
}

.text-page > * {
  max-width: 42rem;
}

.text-page__title {
  font-size: var(--text-h1);
  line-height: 1.06;
  letter-spacing: var(--tracking-display);
}

.text-page__meta {
  margin-top: 1rem;
  color: var(--color-ink-subtle);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.text-page__lead {
  margin-top: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  color: var(--color-ink);
  font-size: var(--text-lead);
  font-weight: 300;
  line-height: 1.55;
  text-wrap: pretty;
}

.text-page__contents {
  margin-top: clamp(2rem, 1.5rem + 2vw, 3rem);
  padding-block: 1.25rem;
  border-block: 1px solid var(--color-line);
  font-size: var(--text-sm);
}

.text-page__contents ol {
  margin: 0;
  padding-inline-start: 1.5rem;
  columns: 2 14rem;
  column-gap: 2rem;
}

.text-page__contents li {
  padding-block: 0.25rem;
  color: var(--color-ink-subtle);
  break-inside: avoid;
}

.text-page__contents a {
  color: var(--color-navy);
  text-decoration: none;
}

.text-page__contents a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.text-page__section {
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  scroll-margin-top: 1.5rem;
}

.text-page h2 {
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);        /* 24 → 30 */
  line-height: 1.15;
  letter-spacing: var(--tracking-heading);
}

.text-page h3 {
  margin-top: 1.75rem;
  color: var(--color-heading);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.4;
}

.text-page :is(p, ul, address) {
  margin-top: 1rem;
  color: var(--color-ink);
  line-height: 1.65;
  text-wrap: pretty;
}

.text-page h3 + p {
  margin-top: 0.5rem;
}

.text-page ul {
  padding-inline-start: 1.25rem;
}

.text-page li + li {
  margin-top: 0.5rem;
}

.text-page li::marker {
  color: var(--color-steel);
}

.text-page :is(p, li, address) a {
  color: var(--color-navy);
  text-decoration-color: rgb(2 49 90 / 0.35);
  text-underline-offset: 0.2em;
}

.text-page :is(p, li, address) a:hover {
  text-decoration-color: currentColor;
}

.text-page__address {
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  border-radius: var(--radius-lg);
  background: var(--color-mist);
  font-style: normal;
}

.text-page__address strong {
  color: var(--color-heading);
  font-weight: 600;
}

.text-page__actions {
  margin-top: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
}

/* the email address is an outline (no text), like on the home page */
.text-page__email {
  display: inline-block;
  vertical-align: -0.06em;   /* puts the outline's baseline on the text's */
  border-bottom: 1px solid rgb(2 49 90 / 0.35);
  color: var(--color-navy);
}

.text-page__email:hover {
  border-bottom-color: currentColor;
}

.text-page__glyphs {
  display: inline-block;
  margin-block: -0.2em -0.24em;
  pointer-events: none;
}

/* Liquid glass — the material for interactive surfaces on dark stages
   (after Apple's Liquid Glass and Glassdoor's navigation pill).
   .glass is the "regular" variant: it blurs and dims what is behind it, so
   panels with a lot of text stay legible. .glass--clear is the thin variant
   for small controls (Glassdoor's pill: a 2–3px blur, a tint, a white hairline).
   Light catches the top edge; with a mouse, the rim lights up where the pointer
   is (--glass-x/--glass-y, set by main.js). Solid fallbacks below for browsers
   without backdrop-filter and for people who reduce transparency. */
@property --glass-x {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 28%;
}

@property --glass-y {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: 0%;
}

.glass {
  --glass-blur: 22px;

  position: relative;
  isolation: isolate;
  background:
    linear-gradient(160deg, rgb(255 255 255 / 0.15) 0%, rgb(255 255 255 / 0.05) 42%, rgb(255 255 255 / 0.07) 100%),
    rgb(3 28 52 / 0.32);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(165%);
  backdrop-filter: blur(var(--glass-blur)) saturate(165%);
  box-shadow:
    inset 0 1px 0.5px rgb(255 255 255 / 0.32),         /* top edge catching the light */
    inset 0 -1px 0.5px rgb(255 255 255 / 0.08),
    inset 0 0 0 1px rgb(255 255 255 / 0.09),           /* rim */
    inset 0 1.5rem 3rem -2.25rem rgb(255 255 255 / 0.16), /* thickness: light pooling under the top edge … */
    inset 0 -1.25rem 2.5rem -2rem rgb(255 255 255 / 0.07), /* … and along the bottom */
    0 2rem 4rem -1.5rem rgb(0 8 20 / 0.55),
    0 0.5rem 1.25rem -0.5rem rgb(0 8 20 / 0.32);
}

/* specular rim, brightest where the light (or the pointer) is, with a
   fainter catch-light at the opposite corner, as through a lens */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 1px;
  border-radius: inherit;
  background:
    radial-gradient(22rem 16rem at var(--glass-x) var(--glass-y), rgb(255 255 255 / 0.75), rgb(255 255 255 / 0.12) 45%, transparent 75%),
    radial-gradient(18rem 12rem at calc(100% - var(--glass-x)) calc(100% - var(--glass-y)), rgb(255 255 255 / 0.3), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

.glass--clear {
  --glass-blur: 3px;

  background:
    linear-gradient(160deg, rgb(255 255 255 / 0.13), rgb(255 255 255 / 0.03)),
    rgb(14 46 78 / 0.38);
  box-shadow:
    inset 0 1px 0.5px rgb(255 255 255 / 0.28),
    inset 0 0 0 1px rgb(255 255 255 / 0.13),
    0 1px 3px rgb(0 6 12 / 0.3),
    0 1px 2px -1px rgb(0 6 12 / 0.3);
}

.glass--clear::after {
  background:
    radial-gradient(8rem 6rem at var(--glass-x) var(--glass-y), rgb(255 255 255 / 0.65), transparent 70%),
    radial-gradient(6rem 4rem at calc(100% - var(--glass-x)) calc(100% - var(--glass-y)), rgb(255 255 255 / 0.25), transparent 70%);
}

.glass--clear:hover {
  background-color: rgb(40 82 122 / 0.5);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass { background-color: rgb(10 44 76 / 0.94); }
}

@media (prefers-reduced-transparency: reduce) {
  .glass,
  .glass--clear {
    background: #0b2f52;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  .glass,
  .glass--clear {
    background: #062541;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.7);
  }
}

@media (forced-colors: active) {
  .glass {
    border: 1px solid CanvasText;
  }
}

/* Contact
   A dark stage (deep navy, a steel fibre-wave, two soft glows) holding the
   contact details and a liquid-glass form panel. The fine lines stay crisp
   around the panel and turn to soft light under it.
   Phones: the stage runs edge to edge, with rounded corners.
   37.5em+: a rounded frame on the container, like the services visual.
   64em+: details left, form right.
   The phone number and email are outlines (no text) in a block that can't be
   selected or copied; main.js decodes the email only when the link is used. */
.contact {
  --contact-pad: clamp(3.5rem, 2.4rem + 4.6vw, 7rem);         /* 56 → 112 */
  --contact-radius: clamp(1.5rem, 1.25rem + 1vw, 2rem);      /* 24 → 32 */
  --color-focus: var(--color-white);
}

.contact ::selection {
  background: rgb(143 177 195 / 0.45);
  color: var(--color-white);
}

.contact__stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: var(--contact-pad) var(--gutter);
  border-radius: var(--contact-radius);
  background:
    radial-gradient(55% 45% at 78% 46%, rgb(30 95 174 / 0.32), transparent 72%),
    radial-gradient(42% 36% at 10% 96%, rgb(143 177 195 / 0.13), transparent 72%),
    linear-gradient(172deg, #022d52 0%, var(--color-night) 48%, #010e1c 100%);
  color: var(--on-dark);
}

/* the stage's own rim catches the light, like the glass on it */
.contact__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.16);
  pointer-events: none;
}

/* phones: the waves flow behind the form and fade out above it */
.contact__backdrop {
  position: absolute;
  inset: 28% 0 -6%;
  z-index: -1;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 25%);
  mask-image: linear-gradient(to bottom, transparent, #000 25%);
}

.contact__waves {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
}

.contact__layout {
  display: grid;
  gap: clamp(2.5rem, 1.9rem + 2.6vw, 4rem);
}

.contact__title {
  color: var(--on-dark);
  font-size: var(--text-h2);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.contact__lead {
  max-width: 30em;
  margin-top: clamp(0.875rem, 0.75rem + 0.5vw, 1.25rem);
  color: var(--on-dark-muted);
  font-size: var(--text-lead);
  font-weight: 300;
  line-height: 1.55;
  text-wrap: pretty;
}

/* Contact details: protected from selection, copying and dragging */
.contact__details {
  margin: clamp(2rem, 1.6rem + 1.6vw, 3rem) 0 0;
  border-top: 1px solid var(--on-dark-line);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.contact__detail {
  display: grid;
  gap: 0.625rem;
  padding-block: clamp(1.125rem, 1rem + 0.5vw, 1.5rem);
  border-bottom: 1px solid var(--on-dark-line);
}

.contact__label {
  color: var(--on-dark-subtle);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* sets the outlined phone number's and email's size: 24 → 30 */
.contact__value {
  margin: 0;
  font-size: clamp(1.5rem, 1.32rem + 0.75vw, 1.875rem);
  line-height: 1;
}

/* the outlines' box is the font's line box (1.3em); trim it to the figures */
.contact__glyphs {
  max-width: 100%;
  margin-block: -0.2em -0.24em;
  pointer-events: none;
}

.contact__email {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  max-width: 100%;
  padding-bottom: 0.3em;
  color: inherit;
  text-decoration: none;
  background: linear-gradient(rgb(255 255 255 / 0.3), rgb(255 255 255 / 0.3)) 0 100% / calc(100% - 0.9em) 1px no-repeat;
}

.contact__email:hover {
  background-image: linear-gradient(var(--color-white), var(--color-white));
}

.contact__email:focus-visible {
  outline-offset: 6px;
}

.contact__email-icon {
  flex: none;
  width: 0.6em;
  height: 0.6em;
  color: var(--color-steel);
}

/* TeamViewer QuickSupport — a clear-glass download control, as in the draft */
.tv-button {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  min-height: 3.5rem;
  padding: 0.5rem 1.25rem 0.5rem 0.5rem;
  border-radius: 1.125rem;   /* concentric: the 40px tile's 10px radius + 8px padding */
  color: var(--on-dark);
  font-size: 1rem;
  text-decoration: none;
}

.tv-button__mark {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  filter: drop-shadow(0 0.25rem 0.5rem rgb(0 40 120 / 0.35));
}

.tv-button__text {
  display: grid;
  gap: 0.125rem;
  line-height: 1.2;
}

.tv-button__name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tv-button__sub {
  color: var(--on-dark-muted);
  font-size: var(--text-xs);
}

.tv-button__icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-inline-start: 0.5rem;
  color: var(--color-steel);
}

.contact__note {
  max-width: 26rem;
  margin-top: 0.875rem;
  color: var(--on-dark-subtle);
  font-size: var(--text-xs);
  line-height: 1.55;
}

.contact__note a {
  color: var(--on-dark);
  font-weight: 500;
  text-decoration-color: rgb(255 255 255 / 0.35);
  text-underline-offset: 0.2em;
}

.contact__note a:hover {
  text-decoration-color: currentColor;
}

.contact__meta {
  color: var(--on-dark-subtle);
  font-weight: 400;
}

.contact__hint {
  display: block;
  margin-top: 0.25rem;
}

/* Form panel */
.contact__panel {
  container: contact-panel / inline-size;
  display: grid;
  padding: clamp(1.5rem, 0.9rem + 2.6vw, 3rem);
  border-radius: clamp(1.25rem, 1rem + 1vw, 1.75rem);
}

.contact__panel > * {
  grid-area: 1 / 1;
}

/* links to #contact-form land with the stage's top edge in view */
.contact-form {
  scroll-margin-top: calc(var(--contact-pad) + 1.5rem + clamp(1.5rem, 0.9rem + 2.6vw, 3rem));
}

.contact-form__title,
.contact-done__title {
  color: var(--on-dark);
  font-size: var(--text-h3);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.contact-form__fields {
  display: grid;
  gap: 1.25rem 1rem;
  margin-top: clamp(1.25rem, 1rem + 1vw, 1.75rem);
}

/* Field — label, input, error */
.field {
  display: grid;
  align-content: start;
  gap: 0.5rem;
}

.field__label {
  color: rgb(255 255 255 / 0.92);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.3;
}

/* required fields: a steel asterisk (the inputs carry `required`, which
   screen readers announce) */
.field__required {
  margin-inline-start: 0.15em;
  color: var(--color-steel);
}

.field__input {
  width: 100%;
  min-height: 3rem;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid rgb(255 255 255 / 0.17);
  border-radius: 0.875rem;
  background-color: rgb(1 18 36 / 0.3);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.2);
  color: var(--on-dark);
  caret-color: var(--color-steel);
  font: inherit;
  font-size: 1rem;              /* 16px keeps iOS from zooming in */
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}

.field__input:hover {
  border-color: rgb(255 255 255 / 0.3);
}

.field__input:focus {
  outline: none;
  border-color: rgb(255 255 255 / 0.8);
  background-color: rgb(1 18 36 / 0.42);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.2), 0 0 0 4px rgb(143 177 195 / 0.3);
}

.field__input--area {
  min-height: 9.5rem;
  resize: vertical;
  line-height: 1.55;
}

/* keep autofilled fields on the glass instead of the browser's yellow */
.field__input:-webkit-autofill {
  -webkit-text-fill-color: var(--on-dark);
  caret-color: var(--on-dark);
  box-shadow: inset 0 0 0 100px #0d3052;
  transition: background-color 600000s 0s;
}

.field.is-invalid .field__input {
  border-color: rgb(255 160 140 / 0.9);
}

.field.is-invalid .field__input:focus {
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.2), 0 0 0 4px rgb(255 160 140 / 0.28);
}

.field__error {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  color: var(--on-dark-error);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.field__error::before {
  content: "";
  flex: none;
  width: 0.9rem;
  height: 0.9rem;
  margin-top: 0.05rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 100 16A8 8 0 008 0zm-.75 4h1.5v5h-1.5zM8 12.4a.95.95 0 110-1.9.95.95 0 010 1.9z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 100 16A8 8 0 008 0zm-.75 4h1.5v5h-1.5zM8 12.4a.95.95 0 110-1.9.95.95 0 010 1.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* spam trap: off screen, out of the tab order and the accessibility tree */
.contact-form__trap {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form__alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid rgb(255 160 140 / 0.35);
  border-radius: 0.875rem;
  background: rgb(255 120 100 / 0.12);
  color: #ffd6cd;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.contact-form__alert-icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.05rem;
}

.contact-form__alert a {
  color: var(--on-dark);
  text-underline-offset: 0.2em;
}

.contact-form__foot {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-form__note {
  max-width: 22rem;
  color: var(--on-dark-subtle);
  font-size: var(--text-xs);
  line-height: 1.5;
}

.contact-form__note a {
  color: var(--on-dark);
  white-space: nowrap;
  text-decoration-color: rgb(255 255 255 / 0.35);
  text-underline-offset: 0.2em;
}

.contact-form__note a:hover {
  text-decoration-color: currentColor;
}

.contact-form__submit {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1.25rem 0.75rem 1.5rem;
  font-size: 1rem;
}

.contact-form.is-sending .contact-form__submit {
  cursor: progress;
}

/* while sending, the arrow becomes a spinner */
.contact-form.is-sending .contact-form__submit .button__icon {
  border: 2px solid rgb(2 49 90 / 0.25);
  border-top-color: var(--color-navy);
  border-radius: 50%;
}

.contact-form.is-sending .contact-form__submit .button__icon use {
  display: none;
}

/* Sent: replaces the form in the same panel, at the same height */
.contact-done {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1rem;
}

.contact-done__icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  color: var(--color-steel);
}

.contact-done__title {
  text-wrap: balance;
}

.contact-done__title:focus {
  outline: none;
}

.contact-done__text {
  max-width: 28em;
  color: var(--on-dark-muted);
  line-height: 1.6;
}

.contact-done__ref {
  color: var(--on-dark);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.contact-done__again {
  margin-top: 0.75rem;
}

@media (min-width: 37.5em) {
  .contact__frame {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
  }

  .contact__stage {
    padding: var(--contact-pad) clamp(2rem, 0.4rem + 5.4vw, 6rem);
    border-radius: var(--contact-radius);
  }

  .contact__backdrop {
    inset: -6% 0;
    -webkit-mask-image: none;
    mask-image: none;
  }

  /* phone and email side by side, remote support below; the rules run on */
  .contact__details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact__detail:nth-child(2) {
    padding-inline-start: 1.5rem;
  }

  .contact__detail--support {
    grid-column: 1 / -1;
  }
}

/* The form pairs phone and email, and puts the button beside the note, only
   when the panel itself has room (it is narrow next to the details at 64em) */
@container contact-panel (min-width: 26rem) {
  .contact-form__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field--full {
    grid-column: 1 / -1;
  }

  .contact-form__foot {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1.5rem;
  }

  .contact-form__submit {
    width: auto;
  }
}

/* Wide screens: details left, form right */
@media (min-width: 64em) {
  .contact__layout {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
    column-gap: clamp(3rem, -1rem + 6vw, 7rem);
  }

  .contact__details {
    display: block;
  }

  .contact__detail:nth-child(2) {
    padding-inline-start: 0;
  }

  /* keep the lines quiet under the details, vivid around the form */
  .contact__backdrop {
    -webkit-mask-image: linear-gradient(100deg, rgb(0 0 0 / 0.32) 0%, rgb(0 0 0 / 0.4) 36%, #000 58%);
    mask-image: linear-gradient(100deg, rgb(0 0 0 / 0.32) 0%, rgb(0 0 0 / 0.4) 36%, #000 58%);
  }

  .contact__waves {
    object-position: 50% 50%;
  }
}


/* 6. Motion — subtle, and only for people who haven't asked for less
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .hero__media img {
    animation: hero-settle 1.8s var(--ease-out) both;
  }

  .hero__title,
  .hero__lead,
  .hero__actions {
    animation: rise var(--dur-slow) var(--ease-out) both;
  }

  .hero__title {
    animation-delay: 120ms;
  }

  .hero__lead {
    animation-delay: 240ms;
  }

  .hero__actions {
    animation-delay: 360ms;
  }

  .button {
    transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
  }

  .button__icon {
    transition: transform var(--dur-base) var(--ease-out);
  }

  .button:hover .button__icon {
    transform: translateX(3px);
  }

  .site-footer__up:hover .button__icon {
    transform: translateY(-3px);
  }

  /* smoked glass: the rim light trails the pointer, like the form's glass */
  .button--smoke {
    transition: --glass-x 450ms var(--ease-out), --glass-y 450ms var(--ease-out), background-color var(--dur-fast) ease;
  }

  /* Services: the opening panel grows and its text fades in; the new visual
     fades in over the old one, which stays until the new one is opaque */
  .service__trigger {
    transition: color var(--dur-base) ease;
  }

  .service__name {
    transition: font-size var(--dur-base) var(--ease-out);
  }

  .service__panel {
    transition: grid-template-rows 500ms var(--ease-out), visibility 0s linear 0s;
  }

  .service.is-closing .service__panel {
    transition: grid-template-rows 500ms var(--ease-out), visibility 0s linear 600ms;
  }

  .service__body {
    transition: opacity 300ms ease 120ms;
  }

  .service.is-closing .service__body {
    transition: opacity 200ms ease;
  }

  .service-visual {
    transition: opacity 600ms ease;
  }

  .doc {
    transition: opacity 500ms ease 120ms, transform 800ms var(--ease-out) 80ms;
  }

  .service.is-closing .service-visual,
  .service.is-closing .doc {
    transition: opacity 0s linear 600ms, transform 0s linear 600ms;
  }

  /* Glass: the rim light trails the pointer a little, like liquid */
  .glass {
    transition: --glass-x 450ms var(--ease-out), --glass-y 450ms var(--ease-out), background-color var(--dur-fast) ease;
  }

  .field__input {
    transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, box-shadow var(--dur-base) var(--ease-out);
  }

  .contact__email-icon,
  .tv-button__icon {
    transition: transform var(--dur-base) var(--ease-out);
  }

  .contact__email:hover .contact__email-icon {
    transform: translate(2px, -2px);
  }

  .tv-button:hover .tv-button__icon {
    transform: translateY(2px);
  }

  .contact-form.is-sending .contact-form__submit .button__icon {
    animation: spin 800ms linear infinite;
  }

  .contact-done:not([hidden]) {
    animation: rise 700ms var(--ease-out) both;
  }

  /* Contact, as it scrolls past: the waves drift, so the lines slide under
     the glass (scroll-driven; static where unsupported). The stage and the
     form panel stay put: a scroll-linked transform on the stage made Samsung
     Internet paint its background apart from its text (Oct 2026) */
  @supports (animation-timeline: view()) {
    .contact__backdrop {
      animation: contact-drift linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
  }
}

@keyframes spin {
  to { transform: rotate(1turn); }
}

@keyframes contact-drift {
  from { transform: translateY(-5%); }
  to   { transform: translateY(5%); }
}

@keyframes hero-settle {
  from { transform: scale(1.045); }
  to   { transform: none; }
}

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