/* ==========================================================================
   Gutnik Dental — site styles
   Visual system: light architecture, warm stone, walnut, glass, light.
   Reference: references/concept-1.png (approved)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --milk:        #F4F2ED;   /* main background */
  --stone:       #E9E5DE;   /* soft stone sections */
  --stone-2:     #DFDAD1;
  --ink:         #292923;   /* main text */
  --ink-2:       #766F65;   /* secondary text */
  --ink-3:       #9A9287;   /* tertiary / numbers */
  --walnut:      #795B43;   /* buttons */
  --walnut-dark: #634936;
  --rule:        #D2CCC2;   /* thin dividers */
  --rule-soft:   #E1DCD3;

  /* Fixel (MacPaw, Ukraine): Display for large headings, Text for the rest */
  --font: 'Fixel Text', 'Segoe UI', sans-serif;
  --font-display: 'Fixel Display', 'Fixel Text', 'Segoe UI', sans-serif;
  --display-weight: 300;
  --display-tracking: -.026em;

  --pad:   clamp(20px, 4.4vw, 80px);          /* page side padding */
  --max:   1680px;                             /* content max width */
  --gap-section: clamp(88px, 9vw, 160px);

  --fs-hero:  clamp(40px, 3.9vw, 86px);
  --fs-h2:    clamp(36px, 3.75vw, 74px);
  --fs-lead:  clamp(18px, 1.42vw, 23px);
  --fs-body:  clamp(17px, 1.18vw, 19px);
  --fs-eyebrow: 11.5px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 240ms;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--milk);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, figure, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible { outline: 1.5px solid var(--walnut); outline-offset: 4px; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--pad)); margin-inline: auto; padding-inline: var(--pad); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--walnut); color: var(--milk); padding: 12px 18px;
}
.skip-link:focus { top: 16px; }

/* Small spaced uppercase label */
.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: .34em;
  line-height: 1.9;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Admin-set zoom around the focal point (see imgStyle in bootstrap.php) */
img[style*="--z"] { transform: scale(var(--z)); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  height: 58px;
  padding: 0 30px 0 34px;
  background: var(--walnut);
  color: #F7F4EE;
  font-size: 16.5px;
  font-weight: 400;
  letter-spacing: .005em;
  white-space: nowrap;
  border-radius: 2px;
  transition: background var(--t) var(--ease);
}
.btn:hover { background: var(--walnut-dark); }
.btn .icon-arrow { flex: none; transition: transform var(--t) var(--ease); }
.btn:hover .icon-arrow { transform: translateX(5px); }
.btn--lg { height: 64px; padding: 0 32px 0 38px; font-size: 18px; gap: 30px; }
.btn--sm { height: 50px; padding: 0 22px 0 26px; font-size: 15px; gap: 18px; }

/* ---------- Header ---------- */
/* The whole header is sticky: the thin top line scrolls away, the logo bar stays.
   (A sticky element only sticks inside its parent, so it has to be the header itself.) */
.site-header { position: sticky; top: -46px; z-index: 50; }
/* menu links land below the sticky bar, not under it */
html { scroll-padding-top: 96px; }
.topline {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 46px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.topline__values { margin-left: auto; white-space: nowrap; }
.topline__values i, .section-rule__values i { font-style: normal; margin: 0 1.1em; color: var(--ink-3); }

.lang { display: flex; align-items: center; gap: 8px; padding-left: 28px; border-left: 1px solid var(--rule); letter-spacing: .2em; }
.lang a { color: var(--ink-3); transition: color var(--t); }
.lang a:hover, .lang a.is-active { color: var(--ink); }
.lang__sep { color: var(--rule); }

.masthead {
  position: relative;
  z-index: 1;
  background: color-mix(in srgb, var(--milk) 92%, transparent);
  backdrop-filter: saturate(1.1) blur(10px);
  transition: box-shadow var(--t), background var(--t);
}
.masthead.is-stuck { box-shadow: 0 1px 0 var(--rule-soft); }
/* backdrop-filter would trap the fixed full-screen menu inside the header strip */
.masthead.is-menu-open { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--milk); }
.masthead__inner {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 116px;
  transition: height var(--t) var(--ease);
}
.masthead.is-stuck .masthead__inner { height: 80px; }

/* Typographic wordmark, as in the reference: GUTNIK DENTAL / small CLINIC */
.brand {
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  color: var(--ink);
  line-height: 1;
  --brand-size: clamp(20px, 1.75vw, 30px);
  transition: font-size var(--t) var(--ease);
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--brand-size);
  letter-spacing: .2em;
  margin-right: -.2em;          /* cancel tracking after the last letter so it centres */
  text-transform: uppercase;
  white-space: nowrap;
  transition: font-size var(--t) var(--ease);
}
.brand__sub {
  margin-top: .78em;
  font-size: calc(var(--brand-size) * .3);
  font-weight: 500;
  letter-spacing: .72em;
  margin-right: -.72em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.masthead.is-stuck .brand { --brand-size: clamp(18px, 1.4vw, 24px); }

.menu { display: flex; align-items: center; gap: clamp(26px, 2.9vw, 52px); margin-left: auto; margin-right: clamp(20px, 3vw, 56px); }
.menu a:not(.btn) {
  position: relative;
  font-size: 15.5px;
  font-weight: 400;
  letter-spacing: .01em;
  padding: 6px 0;
}
.menu a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--walnut); transform: scaleX(0); transform-origin: left;
  transition: transform var(--t) var(--ease);
}
.menu a:not(.btn):hover::after { transform: scaleX(1); }
.menu__book { display: none; }

.burger { display: none; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  min-height: clamp(620px, calc(100svh - 150px), 900px);
}
.hero__text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 72px 0 84px var(--pad);
  isolation: isolate;
}
/* Barely-there plaster, only on the hero's left side */
.hero__text::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background: url("/assets/img/clinic/plaster-light-960.webp") center / cover;
  opacity: .085;
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(105deg, #000 0%, rgba(0,0,0,.6) 55%, transparent 100%);
          mask-image: linear-gradient(105deg, #000 0%, rgba(0,0,0,.6) 55%, transparent 100%);
}
.hero__lines, .founder__lines {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  fill: none; stroke: var(--rule); stroke-width: 1;
  pointer-events: none;
}
.hero__lines path, .founder__lines path { vector-effect: non-scaling-stroke; }

.hero__content {
  /* Like the reference, the heading may run onto the photo's faded light edge */
  width: calc(100% + 5.2vw);
  max-width: 880px;
}
.hero .eyebrow { margin-bottom: clamp(36px, 3.6vw, 60px); }
.hero__title {
  font-size: var(--fs-hero);
  font-weight: var(--display-weight);
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: var(--display-tracking);
  color: var(--ink);
  margin-bottom: clamp(28px, 2.6vw, 44px);
}
@media (min-width: 1024px) {
  .hero__title { white-space: nowrap; }   /* lines are broken by hand */
}
.hero__lead {
  font-size: var(--fs-lead);
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 24ch;
  margin-bottom: clamp(40px, 3.6vw, 60px);
}
.hero__photo { position: relative; overflow: hidden; }
.hero__photo img {
  width: 100%; height: 100%; object-fit: cover;
  /* soft transition from the milk wall into the photo */
  -webkit-mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,.35) 7%, rgba(0,0,0,.8) 15%, #000 22%);
          mask-image: linear-gradient(to right, transparent 0, rgba(0,0,0,.35) 7%, rgba(0,0,0,.8) 15%, #000 22%);
}
@media (min-width: 1024px) { .hero__text::before { right: -9vw; } }   /* plaster runs under the photo edge on desktop only */

/* ---------- Section rule (label —— values) ---------- */
.section-rule {
  display: flex;
  align-items: center;
  gap: 28px;
}
.section-rule .eyebrow { flex: none; }
.section-rule__line { flex: 1; height: 1px; background: var(--rule); }
.section-rule__values {
  flex: none;
  font-size: 10.5px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-2);
}

/* ---------- Directions ---------- */
.directions { padding-top: clamp(48px, 4.4vw, 72px); padding-bottom: clamp(64px, 5.8vw, 104px); }
.directions .section-rule { margin-bottom: clamp(30px, 2.8vw, 44px); }

.directions__list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  /* cells have inner padding for the hover surface; pull the row out so text aligns with the page edge */
  margin-inline: calc(-1 * var(--cell-pad));
  --cell-pad: clamp(14px, 1.3vw, 24px);
}
.direction { position: relative; min-width: 0; }
.direction + .direction::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--rule);
}
.direction__link {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px var(--cell-pad) 22px;
  isolation: isolate;
}
/* warm stone surface on hover */
.direction__link::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--stone);
  opacity: 0;
  transition: opacity var(--t) var(--ease);
}
.direction__link:hover::after, .direction__link:focus-visible::after { opacity: 1; }

.direction__num {
  font-size: 11px; font-weight: 500; letter-spacing: .14em; color: var(--ink-3);
  margin-bottom: 14px;
}
.direction__name {
  font-size: clamp(17px, 1.42vw, 23px);
  font-weight: 400;
  font-family: var(--font-display);
  line-height: 1.25;
  letter-spacing: -.005em;
  margin-bottom: 12px;
  transition: color var(--t);
}
.direction__text {
  font-size: clamp(13.5px, .98vw, 15.5px);
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 24ch;
  margin-bottom: 28px;
}
/* Top row: number + small diagonal arrow; bottom: hairline drawn on hover */
.direction__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.direction__top .direction__num { margin-bottom: 0; }
.direction__arrow {
  flex: none;
  color: var(--ink-3);
  transition: transform var(--t) var(--ease), color var(--t);
}
.direction__line {
  margin-top: auto;
  height: 1px;
  background: var(--walnut);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 460ms var(--ease);
}
.direction__link:hover .direction__name,
.direction__link:focus-visible .direction__name { color: var(--walnut); }
.direction__link:hover .direction__arrow,
.direction__link:focus-visible .direction__arrow { color: var(--walnut); transform: translate(3px, -3px); }
.direction__link:hover .direction__line,
.direction__link:focus-visible .direction__line { transform: scaleX(1); }

/* ---------- Founder ---------- */
.founder {
  display: grid;
  grid-template-columns: minmax(0, 51.5fr) minmax(0, 48.5fr);
  min-height: clamp(720px, 66vw, 1080px);
}
.founder__portrait { position: relative; overflow: hidden; background: var(--stone); }
.founder__portrait img { width: 100%; height: 100%; object-fit: cover; }

.founder__body {
  position: relative;
  isolation: isolate;
  padding: clamp(56px, 6vw, 108px) var(--pad) 0 clamp(36px, 4.4vw, 88px);
}
.founder__content { max-width: 560px; }
.founder .eyebrow { margin-bottom: clamp(22px, 2vw, 34px); }
.founder__title {
  font-size: var(--fs-h2);
  font-weight: var(--display-weight);
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: var(--display-tracking);
  margin-bottom: clamp(26px, 2.4vw, 40px);
}
.founder__text {
  font-size: var(--fs-lead);
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 30ch;
  margin-bottom: clamp(32px, 3vw, 48px);
}
.founder__sign {
  padding-top: clamp(22px, 2vw, 32px);
  border-top: 1px solid var(--rule);
  max-width: 380px;
  margin-bottom: clamp(26px, 2.4vw, 38px);
}
.founder__name { font-size: clamp(20px, 1.6vw, 27px); font-weight: 400; font-family: var(--font-display); letter-spacing: -.01em; line-height: 1.3; }
.founder__role { margin-top: 6px; font-size: 16px; font-weight: 300; color: var(--ink-2); }

.founder__caption {
  position: absolute;
  left: clamp(36px, 4.4vw, 88px);
  bottom: clamp(48px, 4.6vw, 80px);
  padding-bottom: 20px;
  min-width: 260px;
  border-bottom: 1px solid var(--rule);
  font-size: 10.5px;
  letter-spacing: .3em;
}
.founder__detail {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 36%;
  height: 50%;
  overflow: hidden;
  background: var(--stone);
}
.founder__detail img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Laptops: directions become a 4 + 3 grid */
@media (max-width: 1280px) {
  .directions__list { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 8px; }
  .direction:nth-child(4n + 1)::before { display: none; }
  .section-rule__values { display: none; }
  .topline__values { display: none; }
  .lang { margin-left: auto; padding-left: 0; border-left: 0; }
}

/* Tablets and phones: stacked layout, burger menu */
@media (max-width: 1023px) {
  .masthead__inner { height: 84px; gap: 16px; }
  .masthead.is-stuck .masthead__inner { height: 70px; }
  .brand { --brand-size: 22px; }
  .masthead.is-stuck .brand { --brand-size: 19px; }
  .masthead__book { margin-left: auto; }

  .burger {
    display: grid; place-items: center;
    width: 48px; height: 48px; margin-right: -10px;
  }
  .burger__lines { display: grid; gap: 7px; width: 26px; }
  .burger__lines i { display: block; height: 1.3px; background: var(--ink); transition: transform var(--t) var(--ease); }
  .burger[aria-expanded="true"] .burger__lines i:first-child { transform: translateY(4.2px) rotate(45deg); }
  .burger[aria-expanded="true"] .burger__lines i:last-child  { transform: translateY(-4.2px) rotate(-45deg); }

  .menu {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px;
    margin: 0; padding: 120px var(--pad) 48px;
    background: var(--milk);
    opacity: 0; visibility: hidden;
    transition: opacity var(--t) var(--ease), visibility 0s linear var(--t);
  }
  .menu.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
  .menu a:not(.btn) { font-size: clamp(30px, 7.5vw, 44px); font-weight: var(--display-weight); font-family: var(--font-display); letter-spacing: -.02em; padding: 6px 0; }
  .menu__book { display: inline-flex; margin-top: 34px; }

  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero__text { padding: 40px var(--pad) 48px; }
  .hero__content { width: 100%; max-width: 640px; }
  .hero__photo img { -webkit-mask-image: none; mask-image: none; }
  .hero .eyebrow { margin-bottom: 26px; }
  .hero__photo { aspect-ratio: 4 / 3.3; }

  .founder { grid-template-columns: 1fr; min-height: 0; }
  .founder__portrait { aspect-ratio: 4 / 4.6; }
  .founder__body { padding: 52px var(--pad) 0; display: grid; grid-template-columns: 1fr; }
  .founder__caption { position: static; order: 2; margin: 56px 0 22px; min-width: 0; max-width: 300px; }
  .founder__detail { display: none; }   /* the wood texture stays on desktop only */
  .founder__lines { display: none; }
}

@media (max-width: 767px) {
  :root { --fs-hero: clamp(38px, 10.6vw, 48px); --fs-h2: clamp(34px, 9.4vw, 44px); }
  .topline { height: 40px; gap: 16px; }
  .site-header { top: -40px; }

  .masthead__book { display: none; }
  .burger { margin-left: auto; }
  .btn--lg { height: 60px; padding: 0 26px 0 30px; font-size: 17px; width: 100%; justify-content: space-between; }
  .hero__lead { max-width: none; }
  .directions__list { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 4px; }
  .direction:nth-child(4n + 1)::before { display: block; }
  .direction:nth-child(2n + 1)::before { display: none; }
  .direction__text { max-width: none; }
  .section-rule { gap: 18px; }
}
