/* =========================================================
   Dr Valentina Ormazabal — Oral & Maxillofacial Surgery
   Design system · 2025 rebuild
   ========================================================= */

:root {
  /* Palette */
  --ivory:      #F6F3EE;
  --ivory-2:    #EFEBE3;
  --paper:      #FBFAF7;
  --ink:        #1B1E20;
  --ink-soft:   #3A3F42;
  --muted:      #6E7377;
  --line:       #DED8CE;
  --line-soft:  #E8E3DA;
  --petrol:     #26292B;   /* monochrome primary (near-ink) */
  --petrol-2:   #3A3E40;
  --accent:     #B4AB9C;   /* warm stone-grey accent */
  --accent-ghost: rgba(180,171,156,0.16);

  /* Type */
  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Metrics */
  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 2px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
.h-display { font-size: clamp(2.9rem, 7vw, 6.2rem); font-weight: 500; }
.h1 { font-size: clamp(2.4rem, 5.2vw, 4.4rem); }
.h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
.h3 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
.serif-it { font-style: italic; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.6; color: var(--ink-soft); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--petrol);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--accent);
  display: inline-block;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(70px, 11vw, 150px); }
.section--tight { padding-block: clamp(50px, 7vw, 90px); }
.bg-paper { background: var(--paper); }
.bg-ink { background: var(--ink); color: var(--ivory); }
.bg-petrol { background: var(--petrol); color: #e9e5de; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  transition: background .4s var(--ease), padding .4s var(--ease), box-shadow .4s var(--ease);
}
.site-header.scrolled {
  background: rgba(246,243,238,0.92);
  backdrop-filter: blur(10px);
  padding-block: 14px;
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; z-index: 60; color: var(--ink); }
.brand img { height: 30px; width: auto; }
.brand .brand-mark { height: 33px; width: auto; color: currentColor; }
.brand-word { font-family: var(--serif); font-weight: 500; font-size: 1.44rem; line-height: 1; letter-spacing: .005em; color: currentColor; white-space: nowrap; }
.site-header.scrolled .brand .brand-mark { height: 30px; }
.footer__brand { color: #e7eaea; }
.footer__brand .brand-mark { height: 30px; width: auto; vertical-align: middle; margin-right: 11px; color: #fff; }
.footer__brand .brand-word { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; color: #fff; vertical-align: middle; display: inline-block; margin-bottom: 18px; }
.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 40px); }
.nav a.navlink {
  font-size: 0.82rem; font-weight: 500; letter-spacing: 0.04em;
  color: var(--ink); position: relative; padding-block: 6px;
}
.nav a.navlink::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--petrol); transition: width .35s var(--ease);
}
.nav a.navlink:hover::after, .nav a.navlink.active::after { width: 100%; }

.lang {
  display: inline-flex; border: 1px solid var(--line); border-radius: 100px; overflow: hidden;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
}
.lang a { padding: 5px 12px; color: var(--muted); transition: .25s var(--ease); }
.lang a.on { background: var(--ink); color: var(--ivory); }

.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--sans); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em;
  padding: 13px 26px; border-radius: 100px; border: 1px solid transparent;
  transition: .3s var(--ease); white-space: nowrap;
}
.btn--dark { background: var(--ink); color: var(--ivory); }
.btn--dark:hover { background: var(--petrol); }
.btn--outline { border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--ivory); }
.btn--light { background: var(--ivory); color: var(--ink); }
.btn--light:hover { background: #fff; }
.btn--ghost { color: var(--petrol); padding-inline: 0; }
.btn--ghost .arw { transition: transform .3s var(--ease); }
.btn--ghost:hover .arw { transform: translateX(5px); }

/* burger */
.burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; z-index: 60; }
.burger span { width: 24px; height: 2px; background: var(--ink); transition: .3s var(--ease); }
.mobile-nav {
  position: fixed; inset: 0; z-index: 55; background: var(--ivory);
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: var(--gutter); transform: translateY(-100%); transition: transform .5s var(--ease);
}
.mobile-nav.open { transform: translateY(0); }
.mobile-nav a { font-family: var(--serif); font-size: 2rem; padding-block: 8px; color: var(--ink); }
.mobile-nav .m-meta { margin-top: 30px; font-family: var(--sans); font-size: .85rem; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; padding-bottom: clamp(50px, 8vw, 110px); }
.hero__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: end; width: 100%; }
.hero__quote { font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem,1.6vw,1.5rem); color: var(--petrol); margin-bottom: 18px; }
.hero__title { margin-bottom: 26px; }
.hero__aside { border-left: 1px solid var(--line); padding-left: 30px; }
.hero__scroll { position: absolute; left: var(--gutter); bottom: 26px; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.hero__scroll::before { content:""; width: 34px; height: 1px; background: var(--muted); animation: scrollline 2.4s var(--ease) infinite; }
@keyframes scrollline { 0%,100%{transform:scaleX(.3);opacity:.4;transform-origin:left} 50%{transform:scaleX(1);opacity:1;transform-origin:left} }

.portrait-frame { position: relative; }
.portrait-frame img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); filter: grayscale(0.12); }
.portrait-frame::after { content:""; position:absolute; inset: 14px -14px -14px 14px; border: 1px solid var(--accent); border-radius: var(--radius); z-index:-1; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.stat { text-align: left; }
.stat__num { font-family: var(--serif); font-size: clamp(3rem, 6vw, 5rem); line-height: 1; color: var(--ink); }
.stat__num .plus { color: var(--accent); }
.stat__label { margin-top: 10px; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Section head ---------- */
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: end; margin-bottom: clamp(40px, 6vw, 70px); }
.sec-head .lead { max-width: 46ch; }

/* ---------- Treatments ---------- */
.treat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.treat-card { background: var(--ivory); padding: clamp(26px, 3vw, 44px); min-height: 300px; display: flex; flex-direction: column; transition: background .4s var(--ease); position: relative; }
.treat-card:hover { background: var(--paper); }
.treat-card__icon { width: 56px; height: 56px; object-fit: contain; margin-bottom: 26px; opacity: .85; }
.treat-card h3 { margin-bottom: 12px; }
.treat-card p { color: var(--muted); font-size: .96rem; margin: 0 0 auto; }
.treat-card__no { position: absolute; top: 26px; right: 28px; font-family: var(--serif); font-size: 1rem; color: var(--line); }
.treat-card .more { margin-top: 22px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--petrol); opacity: 0; transform: translateY(6px); transition: .35s var(--ease); }
.treat-card:hover .more { opacity: 1; transform: none; }

/* full treatments list */
.tlist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.tlist__item { background: var(--ivory); padding: 26px clamp(20px,2.4vw,36px); display: flex; gap: 22px; align-items: flex-start; transition: background .35s var(--ease); }
.tlist__item:hover { background: var(--paper); }
.tlist__item img { width: 42px; height: 42px; object-fit: contain; opacity: .8; flex: none; }
.tlist__item h3 { font-size: 1.3rem; margin-bottom: 6px; }
.tlist__item p { margin: 0; font-size: .92rem; color: var(--muted); }

/* ---------- About / values ---------- */
.about-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(40px, 6vw, 80px); align-items: start; }
.values { display: grid; gap: 0; margin-top: 10px; }
.value { display: grid; grid-template-columns: auto 1fr; gap: 22px; padding: 26px 0; border-top: 1px solid var(--line); }
.value:last-child { border-bottom: 1px solid var(--line); }
.value__k { font-family: var(--serif); font-size: 1.4rem; color: var(--accent); }
.value h3 { font-size: 1.25rem; margin-bottom: 6px; }
.value p { margin: 0; color: var(--muted); font-size: .95rem; }

.cv-cols { display: grid; grid-template-columns: repeat(2,1fr); gap: 40px; }
.cv-block h4 { font-family: var(--sans); font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--petrol); margin-bottom: 18px; }
.cv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cv-list li { font-size: .92rem; color: var(--ink-soft); padding-left: 18px; position: relative; line-height: 1.5; }
.cv-list li::before { content:""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border: 1px solid var(--accent); border-radius: 50%; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: .78rem; letter-spacing: .04em; padding: 6px 14px; border: 1px solid var(--line); border-radius: 100px; color: var(--ink-soft); }

/* ---------- Cases ---------- */
.cases { display: grid; gap: clamp(50px, 7vw, 90px); }
.case { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px,4vw,60px); align-items: center; }
.case:nth-child(even) .case__media { order: 2; }
.case__media { position: relative; background: #0d0f10; border-radius: var(--radius); overflow: hidden; }
.case__media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.case__tag { position: absolute; top: 16px; left: 16px; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; background: rgba(0,0,0,.55); color: #fff; padding: 6px 12px; border-radius: 100px; backdrop-filter: blur(4px); }
.case h3 { margin-bottom: 14px; }
.case p { color: var(--muted); }
.case__meta { display: flex; gap: 26px; margin-top: 22px; flex-wrap: wrap; }
.case__meta div span { display: block; }
.case__meta .k { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--petrol); margin-bottom: 3px; }
.case__meta .v { font-family: var(--serif); font-size: 1.15rem; }

/* before/after */
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ba figure { margin: 0; }
.ba img { aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); background:#0d0f10; }
.ba figcaption { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }

/* ---------- Instagram / feed ---------- */
.ig-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.ig-cell { aspect-ratio: 1; background: var(--ivory-2); border-radius: var(--radius); overflow:hidden; display:flex; align-items:center; justify-content:center; color: var(--muted); position: relative; }
.ig-cell img { width:100%; height:100%; object-fit: cover; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px,6vw,80px); }
.info-row { display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 22px 0; border-top: 1px solid var(--line); align-items: baseline; }
.info-row:last-child { border-bottom: 1px solid var(--line); }
.info-row .k { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--petrol); }
.info-row .v { font-size: 1.05rem; }
.info-row .v a:hover { color: var(--petrol); }
.map-embed { width: 100%; aspect-ratio: 4/3; border: 1px solid var(--line); border-radius: var(--radius); filter: grayscale(.4) contrast(1.05); }

/* form */
.form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea, .field select {
  font-family: var(--sans); font-size: 1rem; padding: 13px 16px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); transition: .25s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--petrol); background: #fff; }
.field textarea { min-height: 130px; resize: vertical; }

/* ---------- Before / After slider ---------- */
.ba-slider { position: relative; width: 100%; overflow: hidden; border-radius: var(--radius); background: #0d0f10; touch-action: pan-y; cursor: ew-resize; outline: none; }
.ba-slider:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.ba-after { display: block; width: 100%; height: auto; }
.ba-before { position: absolute; top: 0; left: 0; height: 100%; width: 50%; overflow: hidden; z-index: 2; will-change: width; }
.ba-before img { position: absolute; top: 0; left: 0; height: 100%; width: auto; max-width: none; }
.ba-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--ivory); z-index: 3; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.28); will-change: left; }
.ba-knob { position: absolute; top: 50%; left: 50%; width: 42px; height: 42px; transform: translate(-50%,-50%); border-radius: 50%; background: var(--ivory); box-shadow: 0 3px 14px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.ba-knob svg { width: 20px; height: 20px; fill: var(--ink); }
.ba-label { position: absolute; bottom: 12px; z-index: 3; font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.5); padding: 5px 11px; border-radius: 100px; backdrop-filter: blur(3px); pointer-events: none; }
.ba-label--before { left: 12px; }
.ba-label--after { right: 12px; }
.ba-slider.is-animating .ba-before, .ba-slider.is-animating .ba-line { transition: width .9s var(--ease), left .9s var(--ease); }

.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(30px, 4vw, 54px); }
.case-item h3 { font-size: 1.5rem; margin: 20px 0 8px; }
.case-item p { color: var(--muted); font-size: .95rem; margin: 0; }
.case-item .case__meta { margin-top: 16px; }
.case-hint { display: inline-flex; align-items: center; gap: 8px; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 14px; }
.case-hint svg { width: 16px; height: 16px; fill: currentColor; }
@media (max-width: 820px){ .case-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #cfd3d4; padding-block: clamp(56px, 8vw, 90px); }
.footer a { color: #cfd3d4; }
.footer a:hover { color: #fff; }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 46px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer__brand img { height: 30px; margin-bottom: 20px; filter: brightness(0) invert(1); opacity:.9; }
.footer__brand p { max-width: 40ch; color: #9aa0a2; font-size: .92rem; }
.footer h5 { font-family: var(--sans); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: #7f8688; margin: 0 0 18px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: .92rem; }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 28px; font-size: .82rem; color: #7f8688; flex-wrap: wrap; }
.footer__bottom a { text-decoration: underline; text-underline-offset: 3px; }
.socials { display: flex; gap: 14px; }
.socials a { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: .3s var(--ease); }
.socials a:hover { background: var(--petrol); border-color: var(--petrol); }
.socials svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Page hero (subpages) ---------- */
.page-hero { padding-top: clamp(140px, 18vh, 210px); padding-bottom: clamp(40px, 6vw, 70px); }
.page-hero .eyebrow { margin-bottom: 20px; }
.page-hero p.lead { max-width: 54ch; margin-top: 22px; }
.breadcrumb { font-size: .76rem; letter-spacing: .06em; color: var(--muted); margin-bottom: 26px; }
.breadcrumb a:hover { color: var(--petrol); }

/* ---------- Reveal animation ---------- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-delay="1"]{ transition-delay: .08s; }
[data-reveal][data-delay="2"]{ transition-delay: .16s; }
[data-reveal][data-delay="3"]{ transition-delay: .24s; }
[data-reveal][data-delay="4"]{ transition-delay: .32s; }
@media (prefers-reduced-motion: reduce){ [data-reveal]{ opacity:1; transform:none; transition:none; } html{scroll-behavior:auto;} }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { max-width: 18ch; margin-inline: auto; margin-bottom: 16px; }
.cta-band .lead { max-width: 50ch; margin-inline: auto; margin-bottom: 34px; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero__grid, .about-grid, .contact-grid, .case, .cv-cols { grid-template-columns: 1fr; }
  .case:nth-child(even) .case__media { order: 0; }
  .sec-head { grid-template-columns: 1fr; }
  .treat-grid { grid-template-columns: 1fr 1fr; }
  .tlist { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .hero__aside { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 26px; }
  .ig-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .burger { display: flex; }
  .stats { grid-template-columns: 1fr; gap: 20px; }
  .stat { display: flex; align-items: baseline; gap: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
  .stat__num { font-size: 3.2rem; }
  .stat__label { margin: 0; }
  .treat-grid { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr; gap: 30px; }
  .info-row { grid-template-columns: 1fr; gap: 6px; }
  .ba { grid-template-columns: 1fr 1fr; }
  .ig-grid { grid-template-columns: repeat(2,1fr); }
}
