/*
Theme Name: Molecular Derm
Theme URI: https://molecularderm.com
Author: Molecular Derm
Description: Custom block theme for Molecular Derm. Includes a built-in coming-soon mode with a video hero, a launch homepage, and an email waitlist that works out of the box (optionally connected to Mailchimp).
Version: 1.4.0
Requires at least: 6.5
Tested up to: 7.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: molecular-derm
*/

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
.md-main > * { margin-block-start: 0 !important; margin-block-end: 0 !important; }
body { -webkit-font-smoothing: antialiased; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
img { height: auto; }
.md-caps { text-transform: uppercase; letter-spacing: .26em; }
.md-eyebrow { font-family: var(--wp--preset--font-family--montserrat); font-size: 12px; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--wp--preset--color--mauve); }
.md-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--wp--preset--color--brown); outline-offset: 3px; }

/* ---------- Header ---------- */
.md-header { position: relative; z-index: 20; padding: 22px clamp(24px, 5vw, 72px); }
.md-header--bar { background: var(--wp--preset--color--stone-light); }
.md-header--overlay { position: absolute; top: 0; left: 0; right: 0; }
.md-header__note { margin: 0; }
.md-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--wp--preset--color--brown); }
.md-brand img { width: 44px; height: auto; display: block; }
.md-brand .md-brand__light { display: none; }
.md-brand span { font-family: var(--wp--preset--font-family--montserrat); font-size: 12px; font-weight: 500; letter-spacing: .26em; white-space: nowrap; }
.md-header .wp-block-navigation a { text-decoration: none; }
@media (max-width: 600px) { .md-brand span { display: none; } }

/* ---------- Video hero ---------- */
.md-hero.wp-block-cover { min-height: 100vh; min-height: 100svh; padding: 0; align-items: center; overflow: hidden; background: #BDB5AC; }
/* Push the video right so the bottles sit to the right of the text */
.md-hero.wp-block-cover video.wp-block-cover__video-background,
.md-hero.wp-block-cover img.wp-block-cover__image-background {
  inset: auto !important; top: 50% !important; left: 7% !important; right: auto !important; bottom: auto !important;
  width: max(108%, 177.8vh) !important; max-width: none !important; height: auto !important; aspect-ratio: 16 / 9;
  transform: translateY(-50%); object-fit: cover !important;
}
.md-hero.wp-block-cover::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(236,232,226,.94) 0%, rgba(236,232,226,.86) 26%, rgba(236,232,226,.35) 40%, rgba(236,232,226,0) 52%);
}
.md-hero > .wp-block-cover__inner-container { position: static; width: 100%; max-width: none !important;
  padding: 120px clamp(24px, 5vw, 72px) 96px; }
.md-hero__text { position: relative; z-index: 2; max-width: min(28vw, 440px); }
.md-hero .md-hero__text, .md-hero .md-hero__foot { color: var(--wp--preset--color--ink); }
.md-hero h1 { font-size: clamp(40px, 4.4vw, 70px); color: var(--wp--preset--color--brown); }
.md-hero__text > * { margin-left: 0 !important; }
.md-hero h1 { margin-top: 18px; }
.md-hero__sub { margin-top: 22px; max-width: 26em; }
.md-hero__foot { font-family: var(--wp--preset--font-family--montserrat); font-size: 12px !important; position: absolute; left: clamp(24px, 5vw, 72px); bottom: 26px; z-index: 2; margin: 0;
  font-size: 13px; letter-spacing: .12em; color: var(--wp--preset--color--ink); }
.md-video-toggle { position: absolute; right: clamp(24px, 5vw, 72px); bottom: 22px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(254,254,254,.7);
  background: rgba(74,63,55,.35); color: #FEFEFE; display: grid; place-items: center; cursor: pointer; padding: 0;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.md-video-toggle:hover { background: rgba(74,63,55,.55); }
.md-video-toggle svg { width: 14px; height: 14px; fill: currentColor; }

@media (max-width: 1100px) and (min-width: 901px) {
  .md-hero__text { max-width: 36vw; }
  .md-hero.wp-block-cover video.wp-block-cover__video-background,
  .md-hero.wp-block-cover img.wp-block-cover__image-background { width: max(125%, 177.8vh) !important; }
  .md-hero.wp-block-cover::before { background: linear-gradient(90deg, rgba(236,232,226,.95) 0%, rgba(236,232,226,.88) 32%, rgba(236,232,226,.3) 46%, rgba(236,232,226,0) 56%); }
}
/* Phones & tablets: video on top, text below */
@media (max-width: 900px) {
  .md-hero.wp-block-cover { display: block; min-height: 0; background: var(--wp--preset--color--stone-light); }
  .md-hero.wp-block-cover::before { display: none; }
  .md-hero.wp-block-cover video.wp-block-cover__video-background,
  .md-hero.wp-block-cover img.wp-block-cover__image-background {
    position: relative !important; top: 0 !important; left: 0 !important; transform: none; width: 100% !important; height: 54svh !important;
    aspect-ratio: auto; object-position: 50% 60%; display: block; }
  .md-hero > .wp-block-cover__inner-container { padding: 36px 24px 40px; }
  .md-hero h1 { font-size: clamp(38px, 9vw, 56px); }
  .md-hero__text { max-width: 560px; }
  .md-hero__foot { position: static; padding: 0 24px 28px; }
  .md-video-toggle { top: calc(54svh - 56px); bottom: auto; }
  .md-header--overlay .md-brand { color: var(--wp--preset--color--white); }
  .md-header--overlay .md-brand .md-brand__dark { display: none; }
  .md-header--overlay .md-brand .md-brand__light { display: block; }
}

/* ---------- Signup form ---------- */
.md-signup { margin-top: 34px; }
.md-signup__row { display: flex; gap: 10px; max-width: 480px; }
.md-signup__input { flex: 1; min-width: 0; height: 54px; padding: 0 20px; border-radius: 2px; font-family: inherit;
  border: 1px solid rgba(106,91,79,.4); background: rgba(254,254,254,.75); color: var(--wp--preset--color--ink);
  font-size: 16px; font-weight: 400; }
.md-signup__input::placeholder { color: #75685E; }
.md-signup__btn { height: 54px; padding: 0 26px; border: 0; border-radius: 2px; cursor: pointer; white-space: nowrap;
  background: var(--wp--preset--color--brown); color: var(--wp--preset--color--white); font-family: var(--wp--preset--font-family--montserrat); font-size: 13px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  transition: background .2s; }
.md-signup__btn:hover { background: var(--wp--preset--color--ink); }
.md-signup__btn[disabled] { opacity: .7; cursor: default; }
.md-signup__note { margin: 12px 0 0; font-size: 14px; font-family: var(--wp--preset--font-family--montserrat); font-size: 12px; letter-spacing: .04em; color: var(--wp--preset--color--ink); }
.md-signup__msg { margin: 12px 0 0; font-size: 15px; font-weight: 400; color: var(--wp--preset--color--brown); }
.md-signup__msg:empty { display: none; }
.md-signup__hp { position: absolute !important; left: -9999px; }
.md-signup__admin { margin-top: 10px; font-size: 13px; padding: 8px 12px; background: #fff7e6; color: #6b4b00; border-radius: 2px; }
.md-signup--center .md-signup__row { margin: 0 auto; }
.md-signup--center { text-align: center; }
@media (max-width: 520px) { .md-signup__row { flex-direction: column; } .md-signup__input { flex: none; width: 100%; } .md-signup__btn { width: 100%; } }

/* ---------- Sections ---------- */
.md-section { padding-top: var(--wp--preset--spacing--60) !important; padding-bottom: var(--wp--preset--spacing--60) !important; }
.md-cols { gap: clamp(32px, 6vw, 88px) !important; }
@media (max-width: 781px) { .md-cols--reverse { flex-direction: column-reverse; } }
.md-page { padding-top: var(--wp--preset--spacing--50); padding-bottom: var(--wp--preset--spacing--60); }
.md-footer { padding: 26px clamp(24px, 5vw, 72px); border-top: 1px solid rgba(106,91,79,.2); background: var(--wp--preset--color--paper); }
.md-footer p { margin: 0; letter-spacing: .14em; font-family: var(--wp--preset--font-family--montserrat); font-size: 12px !important; text-transform: uppercase; }
.md-signal__word { font-family: var(--wp--preset--font-family--montserrat); font-weight: 400; margin: 36px 0 0; font-size: clamp(20px, 3vw, 28px); color: var(--wp--preset--color--brown); padding-left: .26em; }
.md-signal__tag { margin: 0; padding-left: .3em; }
.md-split-media img { border-radius: 4px; }
.md-collection__list { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid rgba(106,91,79,.25); }
.md-collection__list li { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid rgba(106,91,79,.25); }
.md-collection__list b { font-weight: 400; color: var(--wp--preset--color--brown); }
.md-collection__list span { color: var(--wp--preset--color--ink); }

.md-still.wp-block-cover { min-height: 78vh; }
.md-still > .wp-block-cover__inner-container { width: 100%; max-width: none !important; padding: 0 clamp(24px, 5vw, 72px); }
.md-still .md-still__text { max-width: 420px; color: var(--wp--preset--color--ink); }
.md-still h2 { color: var(--wp--preset--color--brown); }
@media (max-width: 900px) {
  .md-still.wp-block-cover { min-height: 0; padding-top: 52vw !important; align-items: flex-end; }
  .md-still.wp-block-cover img.wp-block-cover__image-background { object-position: 75% 50%; }
  .md-still > .wp-block-cover__inner-container { padding: 0 16px 16px; }
  .md-still .md-still__text { background: rgba(241,239,236,.94); padding: 24px; border-radius: 4px; }
}

/* Embossed monogram band */
.md-signal { text-align: center; }
.md-emboss { width: min(280px, 60vw); aspect-ratio: 429 / 267; margin: 0 auto;
  filter: drop-shadow(-1px -1px 0 rgba(255,255,255,.75)) drop-shadow(1.5px 1.8px 1.5px rgba(70,58,48,.38)); }
.md-emboss i { display: block; width: 100%; height: 100%; background: #D3CFC9;
  -webkit-mask: url(assets/images/monogram.png) center / contain no-repeat; mask: url(assets/images/monogram.png) center / contain no-repeat; }
.md-rule { width: 120px; height: 1px; border: 0; background: var(--wp--preset--color--mauve); opacity: .6; margin: 14px auto !important; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* =====================================================================
   Coming soon page — matches the Lovable design (molecularderm.appliedinsights.dev)
   ===================================================================== */
.luxe {
  --luxe-ink: oklch(32% .02 55);
  --luxe-soft: oklch(42% .02 55);
  --luxe-line: oklch(32% .02 55 / .3);
  --luxe-glow: oklch(97% .005 75);
  --luxe-wash: radial-gradient(ellipse 52% 56% at 50% 55%, oklch(97% .005 75 / .66) 0%, oklch(97% .005 75 / .4) 55%, oklch(97% .005 75 / .06) 100%);
  --font-wide: var(--wp--preset--font-family--montserrat);
  isolation: isolate; position: relative; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; min-height: 100svh;
  color: var(--luxe-ink); background-color: #B8B0A6; background-position: 50% center; background-size: cover;
  font-family: var(--wp--preset--font-family--questrial); font-size: 16px; line-height: 1.5;
}
.luxe *, .luxe *::before, .luxe *::after { box-sizing: border-box; }
.luxe button { cursor: pointer; text-transform: uppercase; }
.luxe-film { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.luxe-scrim { position: absolute; inset: 0; z-index: -1; background: var(--luxe-wash); pointer-events: none; }

.luxe-header { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 32px 56px; }
.luxe-header::before { content: ""; position: absolute; inset: 0 0 -20px; z-index: -1; pointer-events: none;
  background: linear-gradient(oklch(97% .005 75 / .84) 0%, oklch(97% .005 75 / .58) 55%, oklch(97% .005 75 / 0) 100%); }
.luxe-meta { font-family: var(--font-wide); font-weight: 400; font-size: 10px; line-height: 1.5; letter-spacing: .32em; text-transform: uppercase; color: var(--luxe-ink); margin: 0; }
.luxe-center { justify-self: center; }
.luxe-link { justify-self: end; background: none; border: 0; border-bottom: 1px solid var(--luxe-line); border-radius: 0; padding: 6px 0; color: var(--luxe-ink); }
.luxe-link:hover { border-color: var(--luxe-ink); }

.luxe-main { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 40px 24px; animation: luxeReveal .9s ease-out both; }
.luxe-main::before { content: ""; position: absolute; top: 50%; left: 50%; translate: -50% -50%; z-index: -1; pointer-events: none;
  width: min(560px, 96%); height: 106%;
  background: radial-gradient(46% 48%, oklch(97% .005 75 / .72) 0%, oklch(97% .005 75 / .44) 52%, oklch(97% .005 75 / 0) 82%); }
@keyframes luxeReveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.luxe-logo { margin: 0; }
.luxe-logo img { display: block; width: clamp(240px, 30vw, 400px); height: auto; max-width: 100%; }
.luxe-divider { display: block; width: 1px; height: 48px; margin: 32px 0; background: var(--luxe-line); }
.luxe-copy, .luxe-note, .luxe-meta, .luxe-success {
  text-shadow: 0 0 14px oklch(97% .005 75 / .85), 0 0 4px oklch(97% .005 75 / .7); }
.luxe-copy { position: relative; max-width: 340px; margin: 0 0 36px; font-size: 14px; line-height: 1.8; color: var(--luxe-soft);
  text-shadow: 0 0 12px oklch(97% .005 75 / .92), 0 0 4px oklch(97% .005 75 / .8); }
.luxe-copy::before { content: ""; position: absolute; inset: -20px -44px; z-index: -1; background: oklch(97% .005 75 / .28);
  backdrop-filter: blur(13px); -webkit-backdrop-filter: blur(13px);
  -webkit-mask-image: radial-gradient(60% 68%, #000 0%, rgba(0,0,0,.7) 55%, transparent 88%); mask-image: radial-gradient(60% 68%, #000 0%, rgba(0,0,0,.7) 55%, transparent 88%); }

.luxe-form { position: relative; width: min(420px, 100%); margin: 0; text-align: left; }
.luxe-form::before { content: ""; position: absolute; inset: -26px -46px; z-index: -1; background: oklch(97% .005 75 / .3);
  backdrop-filter: blur(16px) saturate(1.04); -webkit-backdrop-filter: blur(16px) saturate(1.04);
  -webkit-mask-image: radial-gradient(58% 66%, #000 0%, rgba(0,0,0,.66) 55%, transparent 88%); mask-image: radial-gradient(58% 66%, #000 0%, rgba(0,0,0,.66) 55%, transparent 88%); }
.luxe-row { display: flex; align-items: center; border-bottom: 1px solid var(--luxe-line); transition: border-color .3s; }
.luxe-row:focus-within { border-color: var(--luxe-ink); }
.luxe-input { flex: 1 1 0%; min-width: 0; height: 52px; padding: 0; border: 0; outline: none; background: none;
  color: var(--luxe-ink); font-family: inherit; font-size: 14px; }
.luxe-input::placeholder { color: var(--luxe-soft); opacity: 1; }
.luxe .luxe-submit { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 0 0 16px;
  background: none; border: 0; border-radius: 0; color: var(--luxe-ink); white-space: nowrap;
  font-family: var(--font-wide); font-weight: 400; font-size: 10px; letter-spacing: .3em; text-transform: uppercase; }
.luxe .luxe-submit:hover { background: none; }
.luxe-submit svg { display: block; transition: transform .3s; }
.luxe-submit:hover svg { transform: translateX(4px); }
.luxe-input:focus-visible { outline: none; }
.luxe-submit:focus-visible, .luxe-link:focus-visible, .luxe-control:focus-visible { outline: 1px solid var(--luxe-ink); outline-offset: 4px; }
.luxe-note { margin: 16px 0 0; font-size: 10px; letter-spacing: .12em; color: var(--luxe-soft); text-align: center; }
.luxe-error { margin: 12px 0 0; font-size: 12px; color: #8a3b2e; text-align: center; }
.luxe-error:empty { display: none; }
.luxe-success { display: flex; align-items: center; gap: 10px; margin: 0; padding: 16px 0; border-bottom: 1px solid var(--luxe-line);
  font-size: 13px; letter-spacing: .1em; animation: luxeReveal .5s ease-out both; }
.luxe-success[hidden] { display: none; }
.luxe-form.is-done > :not(.luxe-success) { display: none !important; }
.luxe-form.is-done::before { display: none; }
.luxe-link[disabled] { opacity: .5; cursor: default; }
.luxe-spinner { animation: luxeSpin 1s linear infinite; }
@keyframes luxeSpin { to { transform: rotate(360deg); } }

.luxe-footer { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 24px 56px 28px;
  font-family: var(--font-wide); font-weight: 400; font-size: 10px; line-height: 1.5; letter-spacing: .24em; text-transform: uppercase; color: var(--luxe-soft); }
.luxe-footer::before { content: ""; position: absolute; inset: -20px 0 0; z-index: -1; pointer-events: none;
  background: linear-gradient(oklch(97% .005 75 / 0) 0%, oklch(97% .005 75 / .58) 45%, oklch(97% .005 75 / .84) 100%); }
.luxe-control { justify-self: end; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--luxe-line); border-radius: 50%; background: none; color: var(--luxe-ink); }
.luxe-control:hover { background: oklch(97% .005 75 / .6); }
.luxe-control svg { width: 13px; height: 13px; }
.luxe-control svg[hidden] { display: none; }

@media (max-width: 700px) {
  .luxe { --luxe-wash: linear-gradient(180deg, oklch(97% .005 75 / .22), oklch(97% .005 75 / .34) 45%, oklch(97% .005 75 / .18)); }
  .luxe-header { padding: 22px; grid-template-columns: 1fr auto; }
  .luxe-header .luxe-meta:first-child { display: none; }
  .luxe-center { justify-self: start; }
  .luxe-meta { font-size: 9px; letter-spacing: .24em; }
  .luxe-logo img { width: 240px; }
  .luxe-divider { height: 32px; margin: 26px 0; }
  .luxe-input { font-size: 16px; }
  .luxe-footer { grid-template-columns: 1fr auto; padding: 18px 22px 22px; font-size: 8px; letter-spacing: .16em; }
  .luxe-footer-mid { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .luxe-main, .luxe-success, .luxe-spinner { animation: none; }
  .luxe-submit svg, .luxe-row { transition: none; }
}
