/* Reflect Optics and Dr Raycho Andreev, Plovdiv.
   The trial lens of the practice's own trial frame: clinic steel and white, the black of the lens case,
   the red of the trial-lens rims and the turquoise cloth of the optician's photos. Light is the clinic,
   dark the darkened examination room. Every colour is a custom property; theme.js sets data-theme, and
   without it the system setting decides. */

@font-face {
    font-family: "Source Serif 4";
    src: url("/fonts/source-serif-4.woff2") format("woff2");
    font-weight: 500 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Geist";
    src: url("/fonts/geist.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --page: #eef1ed;
    --sheet: #ffffff;
    --steel: #dfe4dd;
    --ink: #141617;
    --soft: #474e4d;
    --line: #c8cfc6;
    --red: #a41e14;
    --red-fill: #a41e14;
    --red-deep: #7c150d;
    --teal: #2f6b7a;
    --teal-deep: #24545f;
    --on-colour: #ffffff;
    --header: rgb(238 241 237 / 0.84);
    --shadow: 0 18px 40px -24px rgb(20 22 23 / 0.45);
    --display: "Source Serif 4", "Georgia", serif;
    --text: "Geist", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --radius: 22px;
    --gutter: clamp(16px, 4vw, 40px);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --page: #0f1213;
        --sheet: #171b1c;
        --steel: #1c2224;
        --ink: #e8ebe6;
        --soft: #aeb6b2;
        --line: #2f3739;
        --red: #ff8d80;
        --red-fill: #b3261b;
        --red-deep: #8e1c13;
        --teal: #1f4f5b;
        --teal-deep: #183e47;
        --header: rgb(15 18 19 / 0.82);
        --shadow: 0 18px 40px -24px rgb(0 0 0 / 0.8);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --page: #0f1213;
    --sheet: #171b1c;
    --steel: #1c2224;
    --ink: #e8ebe6;
    --soft: #aeb6b2;
    --line: #2f3739;
    --red: #ff8d80;
    --red-fill: #b3261b;
    --red-deep: #8e1c13;
    --teal: #1f4f5b;
    --teal-deep: #183e47;
    --header: rgb(15 18 19 / 0.82);
    --shadow: 0 18px 40px -24px rgb(0 0 0 / 0.8);
    color-scheme: dark;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--text);
    font-size: 1.0625rem;
    line-height: 1.6;
    overflow-x: clip;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--red);
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
}

a:hover {
    text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
    font-family: var(--display);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0 0 0.5em;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.3rem, 5.6vw, 4.5rem);
    font-variation-settings: "opsz" 60;
}

h2 {
    font-size: clamp(1.8rem, 3.6vw, 2.9rem);
    font-variation-settings: "opsz" 48;
}

h3 {
    font-size: 1.3rem;
    font-variation-settings: "opsz" 24;
    letter-spacing: -0.01em;
}

p {
    margin: 0 0 1em;
}

.wrap {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 50;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--page);
}

.skip:focus {
    top: 12px;
}

.lead {
    font-size: clamp(1.1rem, 1.6vw, 1.25rem);
    color: var(--soft);
    max-width: 38em;
}

/* ---- header ---- */

.top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--header);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--line);
}

.top-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    min-height: 72px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--ink);
    text-decoration: none;
    margin-right: auto;
}

/* No max-width: 100% here, or flexbox squeezes the logo to nothing when the row is full. */
.brand img {
    width: 120px;
    max-width: none;
    height: auto;
}

.brand-doctor {
    display: none;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.25;
    padding-left: 14px;
    border-left: 1px solid var(--line);
}

.brand-doctor small {
    display: block;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--soft);
}

.on-dark {
    display: none;
}

:root[data-theme="dark"] .on-dark {
    display: block;
}

:root[data-theme="dark"] .on-light {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .on-dark {
        display: block;
    }

    :root:not([data-theme]) .on-light {
        display: none;
    }
}

.call {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--red-fill);
    color: var(--on-colour);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
}

.call:hover {
    background: var(--red-deep);
}

.tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    font-size: 0.85rem;
    font-weight: 600;
}

.lang a,
.lang span {
    padding: 6px 10px;
    color: var(--ink);
    text-decoration: none;
}

.lang span {
    background: var(--ink);
    color: var(--page);
}

.theme,
.menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.theme[hidden],
.menu-toggle[hidden] {
    display: none;
}

.theme svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.theme-moon {
    fill: currentColor;
    stroke: none;
}

.theme .theme-sun {
    display: none;
}

:root[data-theme="dark"] .theme .theme-sun {
    display: block;
}

:root[data-theme="dark"] .theme .theme-moon {
    display: none;
}

.menu-bars,
.menu-bars::before,
.menu-bars::after {
    display: block;
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.menu-bars {
    position: relative;
}

.menu-bars::before,
.menu-bars::after {
    content: "";
    position: absolute;
    left: 0;
}

.menu-bars::before {
    top: -5px;
}

.menu-bars::after {
    top: 5px;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
}

.nav a {
    padding: 8px 12px;
    white-space: nowrap;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
}

.nav a:hover {
    background: var(--steel);
}

.nav a[aria-current="page"] {
    background: var(--ink);
    color: var(--page);
}

.has-menu .nav {
    display: none;
}

.has-menu .nav.is-open {
    display: flex;
    flex-direction: column;
    padding: 6px 0 10px;
}

.has-menu .nav.is-open a {
    font-size: 1.1rem;
    padding: 10px 14px;
}

@media (max-width: 420px) {
    .call {
        padding: 9px 12px;
        font-size: 0.9rem;
    }

    .brand img {
        width: 96px;
    }
}

/* Desktop: two rows. Logo, doctor, phone and tools never fit in one row with the navigation
   (about 1270 px against 1100 px of content), so the navigation takes the second row. */
@media (min-width: 900px) {
    html {
        scroll-padding-top: 136px;
    }

    .top-row {
        row-gap: 0;
        padding-bottom: 0;
    }

    .brand-doctor {
        display: block;
    }

    .nav,
    .has-menu .nav {
        display: flex;
        width: 100%;
        flex-wrap: nowrap;
        margin-top: 10px;
        padding: 6px 0;
        border-top: 1px solid var(--line);
    }

    .nav a {
        padding: 6px 12px;
    }

    .menu-toggle,
    .menu-toggle:not([hidden]) {
        display: none;
    }

    .brand img {
        width: 132px;
    }
}

/* ---- buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 12px 24px;
    border-radius: 999px;
    border: 2px solid transparent;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-red {
    background: var(--red-fill);
    color: var(--on-colour);
}

.btn-red:hover {
    background: var(--red-deep);
}

.btn-line {
    border-color: var(--ink);
    color: var(--ink);
}

.btn-line:hover {
    background: var(--ink);
    color: var(--page);
}

.btn-light {
    background: #ffffff;
    color: #141617;
}

.btn-light:hover {
    background: #eef1ed;
}

/* ---- hero with the trial lens ---- */

.hero {
    padding: clamp(28px, 5vw, 64px) 0 clamp(48px, 7vw, 96px);
    background:
        radial-gradient(60% 70% at 85% 20%, var(--steel), transparent 70%),
        var(--page);
}

.hero-grid {
    display: grid;
    gap: 32px;
    align-items: center;
}

.hero-who {
    font-weight: 600;
    color: var(--red);
    margin-bottom: 14px;
}

.hero h1 {
    max-width: 11em;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 28px 0 18px;
}

.hero-note {
    color: var(--soft);
    font-size: 0.95rem;
}

.hero-lens {
    margin: 0;
    order: -1;
}

@media (min-width: 900px) {
    .hero-lens {
        order: 0;
    }
}

.lens {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 32px;
    box-shadow: var(--shadow);
}

.hero-lens figcaption {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--soft);
}

.lens-ground {
    fill: #141617;
}

.lens-tint {
    fill: #10292f;
    opacity: 0.42;
}

.lens-ring {
    fill: none;
    stroke: #d9ddd6;
}

.lens-edge {
    fill: none;
    stroke: #7d857d;
    stroke-width: 2;
}

.lens-ticks {
    stroke: #141617;
    stroke-width: 2;
    stroke-linecap: round;
}

.lens-numbers {
    fill: #141617;
    font-family: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-anchor: middle;
    dominant-baseline: central;
}

.lens-axis {
    transform-box: view-box;
    transform-origin: 300px 250px;
    transform: rotate(-35deg);
}

.lens-axis path {
    stroke: #e0372a;
    stroke-width: 3;
    stroke-linecap: round;
}

.lens-dial {
    transform-box: view-box;
    transform-origin: 300px 250px;
}

@media (prefers-reduced-motion: no-preference) {
    .lens-in {
        animation: lens-focus 1.9s 0.35s cubic-bezier(0.3, 0.7, 0.2, 1) both;
    }

    .lens-dial {
        animation: lens-dial 1.9s 0.1s cubic-bezier(0.3, 0.7, 0.2, 1) both;
    }

    .lens-axis {
        animation: lens-axis 2.3s 0.2s cubic-bezier(0.3, 0.7, 0.2, 1) both;
    }

    .hero-text > * {
        animation: rise 0.8s cubic-bezier(0.3, 0.7, 0.2, 1) both;
    }

    .hero-text > :nth-child(2) {
        animation-delay: 0.08s;
    }

    .hero-text > :nth-child(3) {
        animation-delay: 0.16s;
    }

    .hero-text > :nth-child(n + 4) {
        animation-delay: 0.24s;
    }
}

@keyframes lens-focus {
    from {
        opacity: 0;
    }
}

@keyframes lens-dial {
    from {
        transform: rotate(-60deg);
    }
}

@keyframes lens-axis {
    from {
        transform: rotate(-150deg);
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

@media (min-width: 900px) {
    .hero-grid {
        grid-template-columns: 5fr 6fr;
        gap: 56px;
    }
}

/* ---- bands ---- */

.band {
    padding: clamp(56px, 8vw, 104px) 0;
}

.band-tight {
    padding-top: clamp(28px, 4vw, 48px);
}

.band-steel {
    background: var(--steel);
}

.band-teal {
    background: var(--teal);
    color: var(--on-colour);
}

.band-red {
    background: var(--red-fill);
    color: var(--on-colour);
}

.band-teal a:not(.btn),
.band-red a:not(.btn) {
    color: var(--on-colour);
}

.head-row {
    display: grid;
    gap: 6px 40px;
    margin-bottom: clamp(28px, 4vw, 44px);
}

.head-row h2 {
    margin: 0;
}

.head-row p {
    margin: 0;
    color: var(--soft);
    max-width: 34em;
}

@media (min-width: 900px) {
    .head-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: end;
    }
}

/* ---- the four doors of the home page ---- */

.doors {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.door a {
    position: relative;
    display: block;
    height: 260px;
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--ink);
    text-decoration: none;
    background: var(--steel);
}

.door img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.door a:hover img {
    transform: scale(1.04);
}

.door-text {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--sheet);
    color: var(--soft);
    font-size: 0.95rem;
    line-height: 1.45;
    box-shadow: var(--shadow);
}

.door-text strong {
    display: block;
    color: var(--ink);
    font-family: var(--display);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

.door a:hover strong {
    color: var(--red);
}

@media (min-width: 700px) {
    .doors {
        grid-template-columns: 1.15fr 1fr 1fr;
        grid-template-rows: 280px 280px;
    }

    .door a {
        height: 100%;
    }

    .door-tall {
        grid-row: span 2;
    }

    .door-wide {
        grid-column: span 2;
    }

    .door-text {
        right: auto;
        max-width: 22em;
    }
}

/* ---- places: one card per address, each with its own hours ---- */

.places {
    display: grid;
    gap: 14px;
}

.place {
    --accent: var(--red-fill);
    --on-accent: var(--on-colour);
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
    border-radius: var(--radius);
    background: var(--sheet);
    border-top: 6px solid var(--accent);
}

.place-optics {
    --accent: var(--teal);
}

.place-smolyan {
    --accent: var(--ink);
    --on-accent: var(--page);
}

.place p {
    margin: 0 0 0.4em;
}

.day-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    list-style: none;
    margin: 4px 0 14px;
    padding: 0;
}

.day-strip li {
    padding: 6px 0;
    border-radius: 8px;
    background: var(--steel);
    color: var(--soft);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}

.day-strip li.on {
    background: var(--accent);
    color: var(--on-accent);
}

.place-hours {
    margin: 0 0 12px;
}

.place-hours div {
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.place-hours dt {
    margin-bottom: 6px;
    font-weight: 600;
}

.place-hours dd {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.slot {
    padding: 3px 10px;
    border: 2px solid var(--red-fill);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
}

.slot-nhif {
    background: var(--red-fill);
    color: var(--on-colour);
}

.slot-open {
    border-color: var(--red);
    color: var(--red);
}

.place-when {
    font-size: 1.05rem;
}

.place-when strong {
    font-size: 1.25rem;
}

.place-where {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

@media (min-width: 800px) {
    .places {
        grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
    }

    /* Heading, days, hours and address on the same lines in all three cards. */
    @supports (grid-template-rows: subgrid) {
        .place {
            display: grid;
            grid-row: span 4;
            grid-template-rows: subgrid;
            row-gap: 0;
        }

        .place-where {
            align-self: end;
        }
    }
}

/* ---- the optician's band ---- */

.optics-band {
    display: grid;
    gap: 36px;
    align-items: center;
}

.optics-band p {
    max-width: 34em;
}

.frames {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 170px 170px;
    gap: 12px;
}

.frames li:first-child {
    grid-row: span 2;
}

.frames a,
.frames img {
    display: block;
    width: 100%;
    height: 100%;
}

.frames img {
    object-fit: cover;
    border-radius: 18px;
}

@media (min-width: 900px) {
    .optics-band {
        grid-template-columns: 5fr 6fr;
        gap: 56px;
    }

    .frames {
        grid-template-rows: 220px 220px;
    }
}

/* ---- call band ---- */

.call-band h2 {
    font-size: clamp(2rem, 4.6vw, 3.6rem);
}

.call-phones {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 40px;
    margin: 0 0 28px;
}

.call-phones a {
    font-family: var(--display);
    font-size: clamp(1.7rem, 4.2vw, 3rem);
    font-weight: 600;
    font-variation-settings: "opsz" 48;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
}

.call-phones a:hover {
    text-decoration: underline;
}

/* ---- inner pages: the page head with a trial-lens scale ---- */

.page-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(40px, 7vw, 88px) 0 clamp(32px, 5vw, 56px);
    background: var(--steel);
}

.page-hero::before {
    content: "";
    position: absolute;
    right: -140px;
    top: 50%;
    width: 460px;
    aspect-ratio: 1;
    translate: 0 -50%;
    border-radius: 50%;
    background: repeating-conic-gradient(from -1deg, var(--ink) 0 0.6deg, transparent 0.6deg 5deg);
    -webkit-mask: radial-gradient(circle, transparent 0 58%, #000 58.5% 66%, transparent 66.5%);
    mask: radial-gradient(circle, transparent 0 58%, #000 58.5% 66%, transparent 66.5%);
    opacity: 0.35;
    pointer-events: none;
}

.page-hero::after {
    content: "";
    position: absolute;
    right: -140px;
    top: 50%;
    width: 460px;
    aspect-ratio: 1;
    translate: 0 -50%;
    border-radius: 50%;
    border: 2px solid var(--red);
    scale: 0.56;
    opacity: 0.6;
    pointer-events: none;
}

.page-hero .wrap {
    position: relative;
}

.page-hero h1 {
    max-width: 14em;
}

@media (max-width: 700px) {
    .page-hero::before,
    .page-hero::after {
        display: none;
    }
}

/* ---- about: the CV ---- */

.cv {
    display: grid;
    gap: 40px;
}

.cv-portrait {
    margin: 0;
}

.cv-portrait img {
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
}

.cv-portrait figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--soft);
}

.cv h2 {
    font-size: clamp(1.5rem, 2.6vw, 2.1rem);
    margin-top: 1.6em;
}

.cv h2:first-child {
    margin-top: 0;
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--line);
}

.timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 4px 16px;
    padding: 8px 0 8px 22px;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--page);
    border: 2px solid var(--red);
}

.timeline time,
.timeline .year {
    font-weight: 700;
    color: var(--red);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
    .timeline li {
        grid-template-columns: minmax(0, 1fr);
    }
}

.chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chips li {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--sheet);
    border: 1px solid var(--line);
    font-weight: 500;
}

.plain-list {
    margin: 0;
    padding-left: 1.2em;
}

.plain-list li {
    margin: 0.3em 0;
}

@media (min-width: 900px) {
    .cv {
        grid-template-columns: 4fr 7fr;
        gap: 64px;
        align-items: start;
    }

    .cv-portrait {
        position: sticky;
        top: 100px;
    }
}

/* ---- services ---- */

.service-groups {
    display: grid;
    gap: 14px;
}

.service-group {
    padding: clamp(20px, 3vw, 30px);
    border-radius: var(--radius);
    background: var(--sheet);
}

.service-group:first-child {
    background: var(--ink);
    color: var(--page);
}

.service-group:first-child li::before {
    background: var(--page);
}

.service-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.service-group li {
    position: relative;
    padding: 7px 0 7px 22px;
    border-top: 1px solid var(--line);
}

.service-group:first-child li {
    border-top-color: rgb(238 241 237 / 0.18);
}

:root[data-theme="dark"] .service-group:first-child li {
    border-top-color: rgb(20 22 23 / 0.18);
}

.service-group li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.95em;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--red-fill);
    background: var(--sheet);
}

@media (min-width: 800px) {
    .service-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .service-group:first-child {
        grid-row: span 2;
    }
}

.note-card {
    margin-top: 14px;
    padding: clamp(20px, 3vw, 30px);
    border-radius: var(--radius);
    border: 2px dashed var(--line);
}

.note-card p:last-child {
    margin-bottom: 0;
}

.equipment {
    display: grid;
    gap: 32px;
}

.equipment-text p {
    max-width: 36em;
}

@media (min-width: 900px) {
    .equipment {
        grid-template-columns: 5fr 7fr;
        gap: 56px;
        align-items: start;
    }
}

/* ---- photo grids (equipment, optics, gallery) ---- */

.photos {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 2 220px;
    column-gap: 12px;
}

.photos li {
    break-inside: avoid;
    margin: 0 0 12px;
}

.photos figure {
    margin: 0;
}

.photos a {
    display: block;
    border-radius: 16px;
    overflow: hidden;
}

.photos img {
    width: 100%;
    transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.photos a:hover img {
    transform: scale(1.03);
}

.photos figcaption {
    padding: 6px 2px 0;
    font-size: 0.88rem;
    color: var(--soft);
}

.photos-wide {
    columns: 3 240px;
}

/* ---- optics page ---- */

.optics-page {
    display: grid;
    gap: 36px;
}

.optics-page .hours-card {
    padding: 22px 24px;
    border-radius: var(--radius);
    background: var(--teal);
    color: var(--on-colour);
}

.hours-card h2 {
    font-size: 1.5rem;
}

.hours-card p {
    margin: 0 0 0.4em;
}

.hours-card a {
    color: var(--on-colour);
}

.big-time {
    font-family: var(--display);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 600;
    line-height: 1.1;
}

@media (min-width: 900px) {
    .optics-page {
        grid-template-columns: 7fr 4fr;
        gap: 56px;
        align-items: start;
    }
}

/* ---- contact ---- */

.contact-grid {
    display: grid;
    gap: 18px;
}

.contact-card {
    padding: clamp(20px, 3vw, 32px);
    border-radius: var(--radius);
    background: var(--sheet);
}

.contact-phones {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}

.contact-phones a {
    font-family: var(--display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
    white-space: nowrap;
}

.contact-phones a:hover {
    color: var(--red);
}

.contact-list {
    margin: 0;
}

.contact-list div {
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.contact-list dt {
    font-weight: 700;
}

.contact-list dd {
    margin: 2px 0 0;
}

@media (min-width: 900px) {
    .contact-grid {
        grid-template-columns: 5fr 6fr;
        align-items: start;
    }
}

/* ---- the form ---- */

.contact-form {
    display: grid;
    gap: 16px;
}

.contact-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--page);
    color: var(--ink);
    font: inherit;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
    border-color: var(--red);
    outline-offset: 1px;
}

.contact-form ::placeholder {
    color: var(--soft);
    opacity: 1;
}

.contact-form ul {
    margin: 4px 0 0;
    padding-left: 1.1em;
    color: var(--red);
}

.contact-form .btn {
    justify-self: start;
}

.form-hint {
    margin: 0;
    font-size: 0.88rem;
    color: var(--soft);
}

.contact-sent {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 14px;
    background: var(--teal);
    color: var(--on-colour);
}

.contact-sent strong {
    display: block;
}

/* ---- footer ---- */

.foot {
    padding: clamp(48px, 7vw, 80px) 0 28px;
    background: var(--sheet);
    border-top: 1px solid var(--line);
    font-size: 0.95rem;
}

.foot-grid {
    display: grid;
    gap: 32px;
}

.foot h2 {
    font-family: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 10px;
}

.foot-brand img {
    width: 200px;
    margin-bottom: 16px;
}

.foot-doctor {
    font-weight: 600;
}

.foot p,
.foot address {
    color: var(--soft);
}

.foot address {
    font-style: normal;
    margin-bottom: 14px;
}

.foot address strong {
    color: var(--ink);
}

.foot-phones a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.foot-phones a:hover {
    color: var(--red);
}

.foot-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.foot-links li {
    margin: 0 0 6px;
}

.foot-bottom {
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.foot-bottom p {
    margin: 0;
    font-size: 0.88rem;
}

.foot-bottom a {
    color: var(--soft);
}

@media (min-width: 760px) {
    .foot-grid {
        grid-template-columns: 1.4fr 1.3fr 1fr 0.8fr;
    }
}

/* ---- 404 ---- */

.not-found {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px var(--gutter);
}

.not-found > div {
    max-width: 560px;
}

.not-found img {
    width: 200px;
    margin-bottom: 28px;
}

.chart {
    width: fit-content;
    margin: 0 0 28px;
    text-align: center;
    font-family: var(--display);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: 0.18em;
    color: var(--ink);
}

.chart span {
    display: block;
}

.chart span:nth-child(1) {
    font-size: 4.5rem;
}

.chart span:nth-child(2) {
    font-size: 2.4rem;
}

.chart span:nth-child(3) {
    font-size: 1.3rem;
    color: var(--red);
}

.not-found [lang="en"] {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* lightbox colours: the lens-case black with the trial-lens red */
.lightbox {
    --lb-bg: rgb(15 18 19 / 0.96);
    --lb-text: #eef1ed;
    --lb-accent: #ff8d80;
    --lb-accent-soft: rgb(255 141 128 / 0.18);
}

/* ---- lightbox: /js/lightbox.js opens a linked image enlarged over the page, in a <dialog> ----
   Paste this block into the site's css/site.css. The overlay is dark in every theme and brings its own
   colours and box sizing, so it does not depend on the rest of the stylesheet. To recolour it to the
   site, set these on .lightbox (or on :root): --lb-bg, --lb-text, --lb-accent (focus ring),
   --lb-accent-soft (hover). */

[data-lightbox] {
    cursor: zoom-in;
}

.lightbox,
.lightbox * {
    box-sizing: border-box;
}

html:has(.lightbox[open]) {
    overflow: hidden;
    scrollbar-gutter: stable;
}

.lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 68px 12px 14px;
    border: 0;
    background: var(--lb-bg, rgba(12, 14, 16, 0.95));
    color: var(--lb-text, #f2f2f2);
    color-scheme: dark;
    overscroll-behavior: contain;
}

.lightbox[open] {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px;
}

.lightbox::backdrop {
    background: none;
}

.lightbox-stage {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.lightbox-stage img {
    display: block;
    max-width: none;
    border-radius: 4px;
    background: #fff;
}

.lightbox-caption {
    display: grid;
    place-items: center;
    min-height: 44px;
    max-width: none;
    margin: 0;
    padding: 0 56px;
    color: var(--lb-text, #f2f2f2);
    font-size: 0.92rem;
    line-height: 1.35;
    text-align: center;
}

.lightbox-button {
    position: absolute;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 20px no-repeat;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.lightbox-button:hover {
    border-color: #ffffff;
    background-color: var(--lb-accent-soft, rgba(255, 255, 255, 0.16));
}

.lightbox-button:focus-visible {
    outline: 3px solid var(--lb-accent, #ffffff);
    outline-offset: 3px;
    border-radius: 50%;
}

.lightbox-button[hidden] {
    display: none;
}

.lightbox-close {
    top: 12px;
    right: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}

.lightbox-prev,
.lightbox-next {
    bottom: 14px;
}

.lightbox-prev {
    left: 12px;
    rotate: 180deg;
}

.lightbox-next {
    right: 12px;
}

@media (min-width: 760px) {
    .lightbox {
        padding: 24px 84px 18px;
    }

    .lightbox-caption {
        padding: 0;
    }

    .lightbox-prev,
    .lightbox-next {
        top: calc(50% - 22px);
        bottom: auto;
    }

    .lightbox-prev {
        left: 20px;
    }

    .lightbox-next,
    .lightbox-close {
        right: 20px;
    }

    .lightbox-close {
        top: 20px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .lightbox[open] {
        animation: lightbox-in 0.2s ease;
    }
}

@keyframes lightbox-in {
    from {
        opacity: 0;
    }
}

/* ---- small helpers ---- */

.h3 {
    font-size: 1.35rem;
    font-variation-settings: "opsz" 24;
    letter-spacing: -0.01em;
}

.contact-card > h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}
