/* Dental Familiar · direction: one motif (the tooth of the logo) · Stack Sans Headline / Stack Sans Text
   Palette kept from the brand: the three teeth of the logo (cyan, magenta, green) on paper, dark ink. */

:root {
  --bg: #ffffff;
  --surface: #eef6f8;
  --ink: #1d1a1f;
  --muted: #5b5a60;
  --accent: #00a8c8;
  --accent-ink: #1d1a1f;
  --cyan: #00a8c8;
  --magenta: #e80070;
  --green: #38b048;
  --deep: #0b6a81;      /* deep tone of the cyan, for panels */
  --deep-ink: #ffffff;

  --tone-1: #075a70;
  --tone-2: #0b6f88;
  --tone-3: #1a9fbb;
  --tone-4: #58bdd2;
  --tone-5: #a9dbe6;

  --font-display: "Stack Sans Headline", "Avenir Next", "Helvetica Neue", sans-serif;
  --font-text: "Stack Sans Text", "Avenir Next", system-ui, sans-serif;

  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --radius: 16px;
  --margin: clamp(1rem, 2.2vw, 2rem);
}

html { overflow-x: clip; }
body { background: var(--bg); color: var(--ink); overflow-x: clip; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 300; letter-spacing: -0.022em; line-height: 1.05; }
.head { font-size: var(--step-head); line-height: 1.02; }
.button { font-weight: 500; min-height: 3.25rem; padding: 0 1.5rem; border-radius: 999px; }
.button:hover { background: var(--ink); color: #fff; }
.button-small { min-height: 2.75rem; padding: 0 1.1rem; }
.link { text-decoration-color: transparent; }
.link:hover, .link-plain:hover { text-decoration-color: currentColor; }
.tooth { clip-path: url(#tooth); }

/* ---------- hero · striped card beside the room ---------- */
.hero { display: grid; grid-template-columns: 1fr; gap: 0; padding: 12px; background: var(--surface); }
.room { position: relative; height: 34svh; min-height: 240px; border-radius: var(--radius); overflow: hidden; background: var(--deep); }
.room-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.room-img.is-first { opacity: 1; }
.card { position: relative; margin-top: -24px; background: var(--bg); border-radius: var(--radius); padding: 0 1.25rem 1.75rem; text-align: center; display: grid; justify-items: center; }
.stripe { display: flex; height: 40px; width: 100%; gap: 0; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface); }
.stripe .t { flex: 0 0 28px; height: 100%; clip-path: url(#tooth); margin-right: 6px; }
.stripe .c { background: var(--cyan); } .stripe .m { background: var(--magenta); } .stripe .g { background: var(--green); }
.wordmark { width: 40%; max-width: 300px; height: auto; margin-top: 1rem; background: transparent; }
.hero-title { font-size: clamp(2.25rem, 8vw, 3.5rem); line-height: 1.02; margin-top: .75rem; max-width: 14ch; }
.hero-line { margin-top: .75rem; max-width: 36ch; font-size: max(1.125rem, var(--step-body)); }
.hero-action { margin-top: 1.25rem; }
.card-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin-top: 1.75rem; font-size: var(--step-small); }
@media (min-width: 48em) {
  .hero { grid-template-columns: 1fr 1fr; gap: 12px; min-height: 100svh; }
  .room { order: 2; position: sticky; top: 12px; height: calc(100svh - 24px); min-height: 0; }
  .card { order: 1; margin-top: 0; padding: 0 2.5rem 1.75rem; align-content: start; min-height: calc(100svh - 24px); }
  .stripe { height: 56px; }
  .wordmark { margin-top: 2.5rem; width: 56%; }
  .hero-title { font-size: clamp(2.5rem, 3.6vw, 3.5rem); margin-top: 1.25rem; }
  .card-links { margin-top: auto; padding-top: 2rem; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(5rem, 11vw, 11rem); }

/* tratamientos · shape-marked small points */
.treat { display: grid; grid-template-columns: 1fr; row-gap: 2.5rem; overflow: clip; }
.treat-pic { width: 82vw; margin-left: -10vw; max-height: 60svh; aspect-ratio: 1 / 1; clip-path: url(#tooth); }
.treat-pic img { width: 100%; height: 100%; object-fit: cover; }
.points { display: grid; grid-template-columns: 1fr; row-gap: 1.75rem; margin-top: 2rem; }
.points li { position: relative; padding-left: 1.6rem; }
.pt { position: absolute; left: 0; top: .3em; width: .9em; height: .9em; clip-path: url(#tooth); }
.pt.c { background: var(--cyan); } .pt.m { background: var(--magenta); } .pt.g { background: var(--green); }
.pt-title { font-weight: 500; }
.pt-text { color: var(--muted); font-size: var(--step-small); max-width: 30ch; }
@media (min-width: 48em) and (max-width: 63.99em) {
  .points { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
  .points li { padding-left: 0; }
  .pt { position: static; display: block; margin-bottom: .6rem; }
}
@media (min-width: 64em) {
  .treat { grid-template-columns: 5fr 1fr 6fr; align-items: center; row-gap: 0; }
  .treat-pic { grid-column: 1; width: 112%; margin-left: -12%; height: 78svh; max-height: none; aspect-ratio: auto; }
  .treat-text { grid-column: 3; padding-left: 0; }
  .points { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 2.5rem; row-gap: 2.75rem; margin-top: 3.5rem; }
  .points li { padding-left: 0; }
  .pt { position: static; display: block; margin-bottom: .6rem; }
}

/* nosotros · inset panel, shaped portrait */
.about { padding: 0 20px; }
.panel { position: relative; background: var(--deep); color: var(--deep-ink); border-radius: 12px; overflow: hidden; padding: 2.5rem 1.25rem 0; display: grid; row-gap: 2rem; }
.panel-title { font-size: clamp(2.25rem, 8.5vw, 4rem); line-height: 1.02; max-width: 16ch; color: #fff; }
.panel-text { display: grid; row-gap: 1.75rem; justify-items: start; }
.panel-text h3 { font-family: var(--font-text); font-weight: 500; font-size: var(--step-lead); line-height: 1.2; letter-spacing: 0; margin-bottom: .5rem; color: #fff; }
.panel-text p { color: #e6f3f6; max-width: 36ch; }
.panel-text .button { background: var(--accent); color: var(--accent-ink); }
.panel-text .button:hover { background: #fff; }
.panel-pic { width: 86vw; max-width: 560px; aspect-ratio: 1 / 1; clip-path: url(#tooth); justify-self: center; margin-bottom: -22%; }
.panel-pic img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 48em) {
  .panel { min-height: 110svh; padding: 3.5rem 3.5rem 0; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; column-gap: 3rem; }
  .panel-title { grid-column: 1; grid-row: 1; font-size: clamp(2.5rem, 4.4vw, 4rem); max-width: 14ch; }
  .panel-text { grid-column: 2; grid-row: 1 / span 2; padding-left: 10%; align-content: start; }
  .panel-text > div { width: 300px; }
  .panel-pic { grid-column: 1; grid-row: 2; width: 38vw; max-width: none; align-self: end; justify-self: start; margin-bottom: -20%; }
}

/* primera visita · accordion of tinted panels + chooser */
.visit { background: var(--surface); }
.visit-intro { display: grid; grid-template-columns: 1fr; row-gap: 2rem; margin-bottom: clamp(3rem, 6vw, 4rem); }
.visit-copy { display: grid; row-gap: 1.5rem; }
.visit-copy > p:first-child { font-size: var(--step-lead); line-height: 1.35; max-width: 36ch; }
.chooser { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chooser legend { font-weight: 500; margin-bottom: .75rem; }
.chooser label { position: relative; display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem; background: #fff; color: var(--ink); border-radius: 999px; cursor: pointer; transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.chooser label:hover { background: #d9edf2; }
.chooser label:active { transform: scale(.97); }
.chooser input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.chooser label:has(input:checked) { background: var(--deep); color: #fff; }
.chooser label:has(input:focus-visible) { outline: 2px solid var(--deep); outline-offset: 3px; }
.chooser-action { justify-self: start; }
.chooser-text { max-width: 46ch; min-height: 3lh; }
@media (min-width: 48em) {
  .visit-intro { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
  .visit-intro .head { grid-column: 1 / span 5; }
  .visit-copy { grid-column: 7 / span 6; }
}
.acc { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; }
.acc-panel { background: var(--tone); color: #fff; display: grid; grid-template-rows: auto 0fr; transition: grid-template-rows 450ms var(--ease-in-out); overflow: hidden; }
.acc-panel.is-open { grid-template-rows: auto 1fr; }
.acc-panel:nth-child(3), .acc-panel:nth-child(4), .acc-panel:nth-child(5) { color: var(--ink); }
.acc-panel:not(.is-open) .acc-body { visibility: hidden; }
.acc-head { width: 100%; text-align: left; min-height: 4rem; padding: 0 1.25rem; display: flex; align-items: center; color: inherit; }
.acc-name { font-family: var(--font-text); font-weight: 500; font-size: var(--step-lead); }
.acc-body { min-height: 0; overflow: hidden; }
.acc-body > p { padding: 0 1.25rem 1.25rem; max-width: 36ch; }
.acc-fig { padding: 0; }
.acc-fig img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.acc-fig figcaption { padding: .5rem 1.25rem 1.25rem; font-size: var(--step-small); }
@media (min-width: 48em) {
  .acc { flex-direction: row; height: 520px; }
  .acc-panel { flex: 1 1 0; display: block; position: relative; min-width: 0; transition: flex-grow 450ms var(--ease-in-out); }
  .acc-panel.is-open { flex-grow: 7; }
  .acc-head { position: absolute; inset: 0; min-height: 0; padding: 0; align-items: flex-end; z-index: 2; }
  .acc-panel:not(.is-open) .acc-name { writing-mode: vertical-rl; transform: rotate(180deg); padding: 1.25rem .9rem; white-space: nowrap; }
  .acc-panel.is-open .acc-head { pointer-events: none; }
  .acc-panel.is-open .acc-name { position: absolute; top: 1.5rem; left: 1.75rem; font-family: var(--font-display); font-weight: 300; font-size: 2.5rem; line-height: 1; letter-spacing: -0.02em; }
  .acc-body { position: absolute; inset: 0; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; opacity: 0; visibility: hidden; transition: opacity 300ms ease 150ms, visibility 0s 450ms; }
  .acc-panel.is-open .acc-body { opacity: 1; visibility: visible; transition-delay: 150ms, 0s; }
  .acc-body > p { align-self: end; padding: 0 1.75rem 1.75rem; max-width: 34ch; }
  .acc-fig { grid-column: 2; height: 100%; display: grid; grid-template-rows: 1fr auto; }
  .acc-fig img { height: 100%; aspect-ratio: auto; clip-path: url(#tooth); padding: 1.25rem 1.25rem 0; box-sizing: border-box; }
  .acc-fig figcaption { padding: .5rem 1.25rem .9rem; }
  .acc-body:not(:has(.acc-fig)) > p { grid-column: 1 / span 2; max-width: 40ch; }
}

/* pacientes · one frame, contents change */
.gallery-wrap { display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center; row-gap: 2rem; padding-block: 4vh; }
.gallery .head { text-align: left; justify-self: start; }
.frame { position: relative; width: min(72vw, 300px); aspect-ratio: 1 / 1; clip-path: url(#tooth); background: var(--surface); cursor: pointer; }
.frame-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 600ms ease; }
.frame-img.is-on { opacity: 1; }
.frame-caption { color: var(--muted); font-size: var(--step-small); }
@media (min-width: 48em) {
  .gallery-wrap { grid-template-columns: 5fr 7fr; align-items: center; justify-items: start; text-align: left; padding-block: 4vh; }
  .gallery .head { grid-column: 1; }
  .frame { grid-column: 2; width: min(40vw, 480px); aspect-ratio: 4 / 5; }
  .frame-caption { grid-column: 2; }
}

/* preguntas · accordion of filled tiles */
.faq-grid { display: grid; grid-template-columns: 1fr; row-gap: 2rem; }
.tiles { display: grid; row-gap: 6px; }
details { background: var(--surface); border-radius: var(--radius); }
summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; padding: .9rem 1.25rem; font-weight: 500; font-size: var(--step-body); cursor: pointer; }
summary::-webkit-details-marker { display: none; }
details p { padding: 0 1.25rem 1.25rem; max-width: 52ch; }
.plus { position: relative; width: 16px; height: 16px; flex: 0 0 auto; }
.plus::before, .plus::after { content: ""; position: absolute; left: 0; top: 6.5px; width: 16px; height: 3px; background: currentColor; transition: transform var(--t-ui) var(--ease-out); }
.plus::after { transform: rotate(90deg); }
details[open] { background: var(--accent); color: var(--accent-ink); }
details[open] .plus::after { transform: rotate(0deg); }
@media (min-width: 48em) {
  .faq-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
  .faq-title { grid-column: 1 / span 4; position: sticky; top: 96px; }
  .tiles { grid-column: 5 / span 8; row-gap: 8px; }
  summary { min-height: 72px; padding: 1rem 1.5rem; font-size: var(--step-lead); font-weight: 500; }
  details p { padding: 0 1.5rem 1.5rem; }
}

/* contacto · clip-out coupon form */
.contact { padding-block: clamp(5rem, 10vw, 7.5rem); }
.coupon { position: relative; background: var(--magenta); color: #fff; border-radius: 14px; padding: 2rem 1.25rem; display: grid; row-gap: 1.5rem; }
.coupon::before, .coupon::after { content: ""; position: absolute; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); }
.coupon-title { font-size: clamp(2rem, 7vw, 2.75rem); line-height: 1; color: #fff; max-width: 10ch; }
.coupon-note { max-width: 40ch; color: #fff; }
.coupon-note a { color: #fff; }
.coupon-right { display: grid; row-gap: 10px; }
.coupon-right .field { background: #f8d3e5; color: var(--ink); min-height: 54px; border-radius: 10px; }
.coupon-right .field::placeholder { color: #5d2240; }
.submit { min-height: 56px; background: var(--ink); color: #fff; border-radius: 10px; font-weight: 500; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease; }
.submit:hover { background: #000; }
.submit:active { transform: scale(.98); }
@media (max-width: 47.99em) {
  .coupon::before { left: -14px; top: 46%; } .coupon::after { right: -14px; top: 46%; }
  .coupon-left { padding-bottom: 1.5rem; border-bottom: 5px dotted rgba(255,255,255,.7); } /* taste-skill-ignore: the perforation of a coupon */
}
@media (min-width: 48em) {
  .coupon { grid-template-columns: 46% 54%; column-gap: 0; padding: 0; margin-inline: calc(100% / 12); aspect-ratio: 2.2 / 1; }
  .coupon::before { top: -14px; left: calc(46% - 14px); } .coupon::after { bottom: -14px; left: calc(46% - 14px); }
  .coupon-left { padding: 3rem; display: grid; align-content: space-between; }
  .coupon-right { padding: 3rem; border-left: 5px dotted var(--bg); align-content: center; } /* taste-skill-ignore: the perforation of a coupon */
  .coupon-title { font-size: clamp(2rem, 3vw, 2.75rem); }
}

/* pie · the mark, built large */
.foot { background: var(--surface); color: var(--ink); padding-block: 3rem 1.5rem; }
.mark { height: 34svh; min-height: 180px; display: flex; align-items: flex-end; }
.mark svg { width: 100%; height: 100%; }
.foot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; margin-top: 3.5rem; font-size: var(--step-small); line-height: 1.5; overflow-wrap: anywhere; }
.foot-cols p:first-child { font-weight: 500; }
.foot-last { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 3rem; }
@media (min-width: 64em) { .foot-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); font-size: var(--step-body); } .foot-cols > div:nth-child(3), .foot-cols > div:nth-child(4) { justify-self: end; } }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* signature: slow crossfade of the room, like light shifting */
  .js .room-img { animation: room-fade 18s ease-in-out infinite; }
  .js .room-img:nth-child(1) { animation-delay: 0s; }
  .js .room-img:nth-child(2) { animation-delay: 6s; }
  .js .room-img:nth-child(3) { animation-delay: 12s; }
  .js .hero.is-paused .room-img { animation-play-state: paused; }
  @keyframes room-fade { 0% { opacity: 0; } 9% { opacity: 1; } 33.3% { opacity: 1; } 42% { opacity: 0; } 100% { opacity: 0; } }
  .js .room-img.is-first { opacity: 1; }
  .js [data-reveal] { transition-delay: calc(var(--i, 0) * 70ms); }
  .js .points li[data-reveal] { transform: translateY(16px); }
  .js .treat-pic[data-reveal], .js .panel-pic[data-reveal] { transform: scale(.96); transition-duration: 1100ms; }
  .js .treat-pic[data-reveal].is-in, .js .panel-pic[data-reveal].is-in { transform: none; }
  .js details[data-reveal] { transform: translateY(14px); transition-delay: calc(var(--i, 0) * 60ms); }
  .button:hover { transform: translateY(-2px); }
  .stripe .t { transition: transform var(--t-ui) var(--ease-out); }
  .card:hover .stripe .t { transform: translateY(-3px); }
  .card:hover .stripe .t:nth-child(even) { transform: translateY(3px); }
  summary { transition: background-color var(--t-hover) ease; }
}
@media (prefers-reduced-motion: reduce) {
  .room-img:not(.is-first) { display: none; }
}
