/*
 * Ukiyo Theme for Reveloni CMS
 * Version: 1.0.1
 *
 * A Japanese woodblock print in the school of Hokusai. Flat planes of color,
 * bold asymmetry, generous emptiness - graphics that are a PRINT, not a
 * painting. Three signatures: the bokashi ink-graded sky band crowning the
 * hero (the printer's hand-wiped gradient that defines ukiyo-e), a
 * hand-drawn Great-Wave band with foam claws separating the page from the
 * footer sea, and the vermilion hanko seal as the artist's stamp on CTAs
 * and cards. Gallery plates carry vertical print labels.
 *
 * Day (default) = washi paper, sumi ink, Hokusai indigo.
 * Night = yozakura: indigo-dyed paper, moonlit ink, the seal glowing
 * like a lantern.
 *
 * Typography: Literata (display serif with a printed voice) x Work Sans.
 * Note: genuine mincho faces (Shippori, Zen Kaku) were glyph-tested and
 * lack Polish diacritics - Literata carries the print spirit with full
 * latin-ext coverage.
 */

/* === TOKENS - DAY (washi) === */
:root {
    --uk-paper: #f5efe0;
    --uk-paper-raised: #fbf7ec;

    --uk-ink: #232a38;
    --uk-ink-soft: #5d6472;
    --uk-edge: rgba(35, 42, 56, 0.20);
    --uk-edge-soft: rgba(35, 42, 56, 0.10);

    --uk-indigo: #2c5b8f;
    --uk-indigo-deep: #1e4066;
    --uk-vermilion: #c73e2e;
    --uk-matcha: #7a8c5e;

    /* The footer sea: water + foam text that sits on it (both modes) */
    --uk-water: #1e4066;
    --uk-foam: #f0e9d8;
    --uk-foam-soft: rgba(240, 233, 216, 0.66);
    --uk-foam-faint: rgba(240, 233, 216, 0.28);

    --uk-shadow: 0 8px 26px rgba(35, 42, 56, 0.12);
    --uk-shadow-lift: 0 16px 40px rgba(35, 42, 56, 0.18);

    /* Great Wave band - day colorway */
    --uk-wave: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='360' height='64' viewBox='0 0 360 64'><path d='M0,64 L0,40 C36,26 66,48 106,38 C148,28 168,18 198,26 C238,36 258,22 298,30 C326,36 344,44 360,38 L360,64 Z' fill='%232c5b8f'/><path d='M0,64 L0,30 C28,14 58,38 94,26 C118,18 128,6 148,10 C162,13 160,26 182,28 C216,31 236,12 270,18 C300,24 330,36 360,26 L360,64 Z' fill='%231e4066' opacity='0.9'/><circle cx='94' cy='24' r='4' fill='%23f5efe0'/><circle cx='106' cy='18' r='3' fill='%23f5efe0'/><circle cx='118' cy='23' r='3.5' fill='%23f5efe0'/><circle cx='146' cy='9' r='4' fill='%23f5efe0'/><circle cx='158' cy='14' r='3' fill='%23f5efe0'/><circle cx='170' cy='22' r='3.5' fill='%23f5efe0'/><circle cx='266' cy='17' r='4' fill='%23f5efe0'/><circle cx='278' cy='13' r='3' fill='%23f5efe0'/><circle cx='290' cy='19' r='3.5' fill='%23f5efe0'/><circle cx='30' cy='22' r='3' fill='%23f5efe0'/><circle cx='44' cy='28' r='3.5' fill='%23f5efe0'/><circle cx='330' cy='32' r='3' fill='%23f5efe0'/></svg>");

    /* Kumo cloud divider - sumi ink */
    --uk-kumo: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='26' viewBox='0 0 120 26'><path d='M10,20 Q25,4 45,14 Q60,2 80,12 Q98,4 110,18' fill='none' stroke='%235d6472' stroke-width='2' stroke-linecap='round'/></svg>");

    --font-display: 'Literata', Georgia, serif;
    --font-body: 'Work Sans', 'Segoe UI', sans-serif;

    /* Engine compatibility aliases (markup uses these in inline styles) */
    --text: var(--uk-ink);
    --text-light: var(--uk-ink-soft);
    --border: var(--uk-edge);
    --accent: var(--uk-indigo);

    --transition: 0.26s ease;
    --transition-fast: 0.15s ease;
}

/* === TOKENS - NIGHT (yozakura) === */
[data-theme="dark"] {
    --uk-paper: #1c2738;
    --uk-paper-raised: #243349;

    --uk-ink: #ece5d3;
    --uk-ink-soft: #a9a08a;
    --uk-edge: rgba(236, 229, 211, 0.22);
    --uk-edge-soft: rgba(236, 229, 211, 0.10);

    --uk-indigo: #7ba7d4;
    --uk-indigo-deep: #3c5d86;
    --uk-vermilion: #e25b48;
    --uk-matcha: #93a878;

    --uk-water: #131c2c;
    --uk-foam: #e8e0cc;
    --uk-foam-soft: rgba(232, 224, 204, 0.62);
    --uk-foam-faint: rgba(232, 224, 204, 0.26);

    --uk-shadow: 0 8px 26px rgba(0, 0, 0, 0.42);
    --uk-shadow-lift: 0 16px 40px rgba(0, 0, 0, 0.52);

    /* Great Wave band - night colorway (moonlit) */
    --uk-wave: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='360' height='64' viewBox='0 0 360 64'><path d='M0,64 L0,40 C36,26 66,48 106,38 C148,28 168,18 198,26 C238,36 258,22 298,30 C326,36 344,44 360,38 L360,64 Z' fill='%233c5d86'/><path d='M0,64 L0,30 C28,14 58,38 94,26 C118,18 128,6 148,10 C162,13 160,26 182,28 C216,31 236,12 270,18 C300,24 330,36 360,26 L360,64 Z' fill='%23131c2c' opacity='0.92'/><circle cx='94' cy='24' r='4' fill='%23e8e0cc'/><circle cx='106' cy='18' r='3' fill='%23e8e0cc'/><circle cx='118' cy='23' r='3.5' fill='%23e8e0cc'/><circle cx='146' cy='9' r='4' fill='%23e8e0cc'/><circle cx='158' cy='14' r='3' fill='%23e8e0cc'/><circle cx='170' cy='22' r='3.5' fill='%23e8e0cc'/><circle cx='266' cy='17' r='4' fill='%23e8e0cc'/><circle cx='278' cy='13' r='3' fill='%23e8e0cc'/><circle cx='290' cy='19' r='3.5' fill='%23e8e0cc'/><circle cx='30' cy='22' r='3' fill='%23e8e0cc'/><circle cx='44' cy='28' r='3.5' fill='%23e8e0cc'/><circle cx='330' cy='32' r='3' fill='%23e8e0cc'/></svg>");

    --uk-kumo: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='26' viewBox='0 0 120 26'><path d='M10,20 Q25,4 45,14 Q60,2 80,12 Q98,4 110,18' fill='none' stroke='%23a9a08a' stroke-width='2' stroke-linecap='round'/></svg>");
}

/* === BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1.01rem;
    line-height: 1.78;
    color: var(--uk-ink);
    background-color: var(--uk-paper);
    min-height: 100vh;
    transition: background-color var(--transition), color var(--transition);
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
}

main {
    min-height: 55vh;
    padding-bottom: 3rem;
}

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

/* A clean printed rule under links; the seal color answers on hover */
a {
    color: var(--uk-indigo);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--uk-edge);
    text-underline-offset: 0.2em;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover {
    color: var(--uk-vermilion);
    text-decoration-color: var(--uk-vermilion);
}

::selection {
    background: var(--uk-indigo);
    color: var(--uk-paper);
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.18;
    color: var(--uk-ink);
    letter-spacing: -0.012em;
}

h1 {
    font-size: clamp(2.4rem, 5.4vw, 3.9rem);
    font-weight: 500;
}

h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.28rem; }

p { margin-bottom: 1.15rem; }

/* === HEADER === */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--uk-paper-raised) 90%, transparent);
    border-bottom: 1px solid var(--uk-edge-soft);
}

/* Backdrop blur on a pseudo-element, not on <header> (menu fix).
   Prevents the header from becoming a containing block for the mobile
   dropdown's position:fixed - which collapsed it to a strip and pushed
   it off-screen. Frosted look unchanged. */
header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    gap: 1.6rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    flex: 1 1 auto;
}

.logo-container img {
    height: 60px;
    width: auto;
    flex-shrink: 0;
}

.logo-container a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.site-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--uk-ink);
    overflow-wrap: break-word;
    min-width: 0;
}

/* A small hanko before the title - the printmaker's mark */
.site-title::before {
    content: '';
    display: inline-block;
    width: 0.58em;
    height: 0.58em;
    margin-right: 0.45rem;
    background: var(--uk-vermilion);
    border-radius: 2px;
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--uk-paper) 65%, transparent);
    transform: rotate(-4deg);
    vertical-align: baseline;
}

/* === BREADCRUMBS === */
.breadcrumbs {
    padding: 1.4rem 0 0.3rem;
    font-size: 0.85rem;
    color: var(--uk-ink-soft);
    letter-spacing: 0.02em;
}

.breadcrumbs a {
    color: var(--uk-ink-soft);
    text-decoration-color: var(--uk-edge-soft);
}

.breadcrumbs a:hover {
    color: var(--uk-indigo);
}

.breadcrumbs span {
    margin: 0 0.35rem;
    color: var(--uk-edge);
}

/* === NAVIGATION === */
nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hamburger-menu {
    position: relative;
}

.hamburger-btn {
    background: var(--uk-paper-raised);
    border: 1px solid var(--uk-edge);
    color: var(--uk-ink);
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.86rem;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
    border-radius: 3px;
    transition: all var(--transition-fast);
}

/* The markup ships its own <span>☰</span> - styled, never duplicated */
.hamburger-btn span:first-child {
    color: var(--uk-vermilion);
}

.hamburger-btn:hover {
    border-color: var(--uk-indigo);
    box-shadow: var(--uk-shadow);
}

/* === DROPDOWN MENU === */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 270px;
    max-height: 80vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    margin-top: 0.65rem;
    background: var(--uk-paper-raised);
    border: 1px solid var(--uk-edge);
    border-radius: 4px;
    padding: 0.55rem 0;
    list-style: none;
    z-index: 1000;
    box-shadow: var(--uk-shadow-lift);
}

@keyframes uk-print {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-menu.active {
    display: block;
    animation: uk-print 0.18s ease-out;
}

.dropdown-menu ul {
    display: block;
    list-style: none;
}

.dropdown-menu li { margin: 0; }

.dropdown-menu a {
    display: block;
    padding: 0.58rem 1.25rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--uk-ink);
    border-left: 2px solid transparent;
    transition: background var(--transition-fast), color var(--transition-fast),
                border-color var(--transition-fast);
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
    background: color-mix(in srgb, var(--uk-indigo) 9%, transparent);
    color: var(--uk-indigo);
    border-left-color: var(--uk-vermilion);
}

.dropdown-submenu {
    padding-left: 1rem;
    font-size: 0.86rem;
    list-style: none;
}

.dropdown-submenu a { padding: 0.48rem 1.25rem; font-weight: 400; }

.dropdown-subsubmenu {
    padding-left: 2rem;
    font-size: 0.82rem;
    list-style: none;
}

.dropdown-subsubmenu a { padding: 0.42rem 1.25rem; font-weight: 400; }

/* === DARK MODE TOGGLE === */
/* The engine renders this button AFTER the footer - it must be fixed
   (lesson from Blueprint/Trencadis 1.0.1) */
.dark-mode-toggle {
    position: fixed;
    bottom: 1.6rem;
    right: 1.6rem;
    z-index: 1200;
    background: var(--uk-paper-raised);
    border: 1px solid var(--uk-edge);
    color: var(--uk-ink);
    width: 46px;
    height: 44px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    box-shadow: var(--uk-shadow);
    transition: all var(--transition-fast);
}

.dark-mode-toggle:hover {
    border-color: var(--uk-indigo);
    box-shadow: var(--uk-shadow-lift);
}

/* === HERO (bokashi sky - signature 1) === */
/* The printer's hand-wiped ink gradient at the top of the sheet:
   saturated indigo at the very top, fading into the paper. */
.hero {
    padding: 5.2rem 0 3.6rem;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--uk-indigo) 30%, var(--uk-paper)) 0,
        color-mix(in srgb, var(--uk-indigo) 14%, var(--uk-paper)) 90px,
        transparent 240px);
}

[data-theme="dark"] .hero {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--uk-indigo) 26%, var(--uk-paper)) 0,
        color-mix(in srgb, var(--uk-indigo) 12%, var(--uk-paper)) 90px,
        transparent 240px);
}

/* Bold asymmetry: the title leaves the right half of the sheet empty */
.hero h1 {
    max-width: 16ch;
    margin-bottom: 0.8rem;
}

.hero p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.12rem;
    color: var(--uk-ink-soft);
    max-width: 520px;
    margin-bottom: 0;
}

/* === CONTENT === */
.content-section {
    padding: 2rem 0 2.4rem;
}

.content-section h2 {
    margin: 2.4rem 0 1.15rem;
    position: relative;
    padding-bottom: 0.85rem;
}

/* A single sumi brush stroke under headings - tapered at both ends */
.content-section h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 104px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        transparent 0, var(--uk-ink) 14%, var(--uk-ink) 84%, transparent 100%);
    transform: rotate(-0.6deg);
}

.content-section h3 {
    margin: 1.7rem 0 0.7rem;
    color: var(--uk-indigo);
}

.content-section ul,
.content-section ol {
    margin: 0 0 1.15rem 1.5rem;
}

.content-section li::marker {
    color: var(--uk-vermilion);
}

.content-section blockquote {
    margin: 1.6rem 0;
    padding: 1rem 1.5rem;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.06rem;
    background: var(--uk-paper-raised);
    border-left: 3px solid var(--uk-indigo);
    border-radius: 3px;
}

.content-section img {
    border: 1px solid var(--uk-edge-soft);
    border-radius: 3px;
    box-shadow: var(--uk-shadow);
    margin: 0.6rem 0;
}

.content-section table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.2rem 0;
    font-size: 0.95rem;
}

.content-section th,
.content-section td {
    border-bottom: 1px solid var(--uk-edge-soft);
    padding: 0.55rem 0.8rem;
    text-align: left;
}

.content-section th {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--uk-indigo);
}

/* Price - a paper tag with an ink frame */
.price-tag {
    display: inline-block;
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--uk-ink);
    background: var(--uk-paper-raised);
    border: 1px solid var(--uk-ink);
    padding: 0.35rem 1rem;
    margin: 0.4rem 0 1rem;
    border-radius: 2px;
    box-shadow: 2.5px 2.5px 0 var(--uk-edge);
}

/* === BUTTONS === */
/* CTA = the hanko seal (signature 3): vermilion square, inner ring,
   the artist's stamp pressed slightly askew */
.cta-button {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: 0.04em;
    color: #f7f1e2;
    background: var(--uk-vermilion);
    border: none;
    text-decoration: none;
    padding: 0.9rem 2rem;
    margin: 1.2rem 0;
    border-radius: 4px;
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--uk-paper) 55%, transparent),
                var(--uk-shadow);
    transform: rotate(-1.6deg);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast),
                background var(--transition-fast);
}

.cta-button:hover {
    transform: rotate(0deg) translateY(-2px);
    background: color-mix(in srgb, var(--uk-vermilion) 88%, #000000);
    color: #f7f1e2;
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--uk-paper) 55%, transparent),
                var(--uk-shadow-lift);
}

.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--uk-indigo);
    background: transparent;
    border: 1.5px solid var(--uk-indigo);
    text-decoration: none;
    padding: 0.7rem 1.7rem;
    cursor: pointer;
    border-radius: 3px;
    transition: all var(--transition-fast);
}

.btn:hover {
    background: var(--uk-indigo);
    color: var(--uk-paper);
    box-shadow: var(--uk-shadow);
}

/* === PAGE CARDS (prints on passe-partout) === */
.page-cards-grid,
.subpages-sections .page-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    justify-content: center;
    gap: 2.2rem;
    padding: 2rem 0 3rem;
}

.page-card {
    background: var(--uk-paper-raised);
    border: 1px solid var(--uk-edge-soft);
    border-radius: 3px;
    /* paper margin around the plate, like a mounted print */
    padding: 0.9rem 0.9rem 0;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--uk-shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.page-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--uk-shadow-lift);
}

/* The collector's hanko in the corner of every print */
.page-card::after {
    content: '';
    position: absolute;
    top: 1.3rem;
    right: 1.3rem;
    width: 0.85rem;
    height: 0.85rem;
    background: var(--uk-vermilion);
    border-radius: 2px;
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--uk-paper) 60%, transparent);
    transform: rotate(5deg);
    opacity: 0.92;
    pointer-events: none;
}

.page-card-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    border: 1px solid var(--uk-edge-soft);
    border-radius: 2px;
}

.page-card-placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--uk-edge-soft);
    border-radius: 2px;
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--uk-indigo) 24%, var(--uk-paper)) 0,
            transparent 70%),
        var(--uk-paper);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-style: italic;
    color: var(--uk-ink-soft);
}

.page-card-content {
    padding: 1.2rem 0.7rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.page-card-title {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.page-card-excerpt {
    font-size: 0.94rem;
    color: var(--uk-ink-soft);
    flex: 1;
}

.page-card-link {
    align-self: flex-start;
    margin-top: 1.1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--uk-indigo);
}

.page-card-link:hover {
    color: var(--uk-vermilion);
}

/* === GALLERY (print plates with vertical labels) === */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    justify-content: center;
    gap: 1.8rem;
    counter-reset: uk-plate;
    padding: 0.6rem 0 1rem;
}

.gallery-item {
    position: relative;
    cursor: zoom-in;
    counter-increment: uk-plate;
    background: var(--uk-paper-raised);
    border: 1px solid var(--uk-edge-soft);
    border-radius: 3px;
    padding: 0.7rem;
    /* room for the vertical label band */
    padding-right: 2rem;
    box-shadow: var(--uk-shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--uk-shadow-lift);
}

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--uk-edge-soft);
    border-radius: 2px;
}

/* Vertical print label on the right margin - calligraphic column.
   Decorative: pointer-events none so it never eats the lightbox click. */
.gallery-item::after {
    content: 'RYC. ' counter(uk-plate, decimal-leading-zero);
    position: absolute;
    top: 0.7rem;
    right: 0.45rem;
    writing-mode: vertical-rl;
    font-family: var(--font-display);
    font-size: 0.68rem;
    letter-spacing: 0.32em;
    color: var(--uk-ink-soft);
    pointer-events: none;
}

/* === LIGHTBOX === */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(16, 22, 34, 0.93);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 86%;
    border: 6px solid #f0e9d8;
    border-radius: 2px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.lightbox-close,
.lightbox-nav,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    width: 46px;
    height: 44px;
    background: rgba(240, 233, 216, 0.10);
    color: #f0e9d8;
    border: 1px solid rgba(240, 233, 216, 0.4);
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: all var(--transition-fast);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(240, 233, 216, 0.22);
    border-color: #f0e9d8;
}

.lightbox-close { top: 1.5rem; right: 1.5rem; }
.lightbox-prev { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.5rem; top: 50%; transform: translateY(-50%); }

.lightbox-counter {
    position: absolute;
    bottom: 1.4rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.92rem;
    color: rgba(240, 233, 216, 0.85);
}

/* === TESTIMONIALS === */
.testimonials-section {
    padding: 2.6rem 0 3rem;
}

.testimonials-section h2 {
    margin-bottom: 1.8rem;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: var(--uk-paper-raised);
    border: 1px solid var(--uk-edge-soft);
    border-radius: 3px;
    padding: 1.5rem 1.6rem 1.3rem;
    position: relative;
    box-shadow: var(--uk-shadow);
}

/* A small hanko pressed beside every voice */
.testimonial-card::before {
    content: '';
    position: absolute;
    top: 1.2rem;
    right: 1.3rem;
    width: 0.8rem;
    height: 0.8rem;
    background: var(--uk-vermilion);
    border-radius: 2px;
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--uk-paper) 60%, transparent);
    transform: rotate(-6deg);
    opacity: 0.9;
    pointer-events: none;
}

.testimonial-text {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.02rem;
}

.testimonial-author {
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--uk-indigo);
}

.testimonial-author::before {
    content: '— ';
    color: var(--uk-edge);
}

.testimonial-rating {
    margin-top: 0.3rem;
    color: var(--uk-vermilion);
    letter-spacing: 0.16em;
    font-size: 0.88rem;
}

/* === CONTACT FORM === */
.contact-form {
    max-width: 640px;
    margin: 1rem 0 2rem;
}

.form-group {
    margin-bottom: 1.35rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.87rem;
    letter-spacing: 0.03em;
    color: var(--uk-ink-soft);
    margin-bottom: 0.45rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--uk-paper-raised);
    border: 1px solid var(--uk-edge);
    color: var(--uk-ink);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.78rem 1rem;
    border-radius: 3px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group textarea {
    min-height: 160px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--uk-indigo);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--uk-indigo) 16%, transparent);
}

.success,
.error {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.95rem 1.3rem;
    margin: 1rem 0;
    border-radius: 3px;
}

.success {
    color: #2c4a32;
    background: color-mix(in srgb, var(--uk-matcha) 24%, var(--uk-paper-raised));
    border: 1px solid var(--uk-matcha);
}

[data-theme="dark"] .success {
    color: #dcebd9;
}

.error {
    color: #7a261a;
    background: color-mix(in srgb, var(--uk-vermilion) 16%, var(--uk-paper-raised));
    border: 1px solid var(--uk-vermilion);
}

[data-theme="dark"] .error {
    color: #ffd9d0;
}

/* === ONE-PAGE & SUBPAGE SECTIONS (kumo cloud dividers) === */
.onepage-sections section,
.subpages-sections section {
    padding: 2.6rem 0;
    position: relative;
}

.onepage-sections section + section::before,
.subpages-sections section + section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 26px;
    background-image: var(--uk-kumo);
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.7;
    pointer-events: none;
}

/* === SCROLL ANIMATIONS === */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(var(--animation-offset, 14px));
    transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* === FOOTER = THE SEA (signature 2: the Great Wave) === */
footer {
    margin-top: 4.5rem;
    background: var(--uk-water);
    color: var(--uk-foam);
    position: relative;
    padding-top: 64px;
}

/* The hand-drawn wave band with foam claws, breaking onto the page */
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-image: var(--uk-wave);
    background-size: auto 100%;
    background-repeat: repeat-x;
    pointer-events: none;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 2.2rem;
    padding: 1.6rem 0 1.6rem;
}

.footer-section {
    min-width: 0;
}

.footer-section h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.08rem;
    color: var(--uk-foam);
    margin-bottom: 0.85rem;
    position: relative;
    padding-bottom: 0.55rem;
}

/* Brush stroke in foam under footer headings */
.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 52px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        transparent 0, var(--uk-foam-soft) 18%, var(--uk-foam-soft) 82%, transparent 100%);
}

.footer-section p {
    font-size: 0.93rem;
    margin-bottom: 0.4rem;
    color: var(--uk-foam-soft);
}

.footer-section a {
    color: var(--uk-foam);
    text-decoration-color: var(--uk-foam-faint);
}

.footer-section a:hover {
    color: #ffffff;
    text-decoration-color: var(--uk-foam);
}

.footer-menu {
    list-style: none;
}

.footer-menu li {
    margin-bottom: 0.4rem;
    font-size: 0.93rem;
}

.footer-menu a {
    text-decoration: none;
    color: var(--uk-foam-soft);
    transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.footer-menu a:hover {
    color: var(--uk-foam);
    padding-left: 0.3rem;
}

.social-links {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.social-links a {
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    color: var(--uk-water);
    background: var(--uk-foam);
    padding: 0.42rem 1rem;
    border-radius: 3px;
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.copyright {
    border-top: 1px solid var(--uk-foam-faint);
    padding: 1rem 0 1.3rem;
    font-size: 0.86rem;
    color: var(--uk-foam-soft);
}

.copyright p {
    margin: 0;
}

.copyright a {
    color: var(--uk-foam-soft);
    text-decoration: none;
}

.copyright a:hover {
    color: var(--uk-foam);
}

/* === ACCESSIBILITY === */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--uk-vermilion);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .animate-on-scroll { opacity: 1; transform: none; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container {
        padding: 0 1.15rem;
    }

    .header-content {
        gap: 0.7rem;
    }

    nav {
        flex-shrink: 0;
    }

    .hamburger-btn {
        padding: 0.55rem 0.8rem;
    }

    .hamburger-btn span:last-child {
        display: none;
    }

    .logo-container img {
        height: 44px;
    }

    .site-title {
        font-size: 1.22rem;
    }

    .dark-mode-toggle {
        bottom: 1.1rem;
        right: 1.1rem;
        width: 42px;
        height: 40px;
    }

    .hero {
        padding: 3.4rem 0 2.8rem;
    }

    footer {
        padding-top: 44px;
    }

    footer::before {
        height: 44px;
    }

    .gallery-item {
        padding-right: 1.9rem;
    }

    .page-cards-grid,
    .gallery-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .dropdown-menu {
        /* Mobile fix (6.2.5): bind top AND bottom so the scroll area
           equals the visible screen - reaches the last item in landscape.
           Paired with the body-scroll lock in script.js. */
        position: fixed;
        top: 70px;
        bottom: 12px;
        left: 1rem;
        right: 1rem;
        margin-top: 0;
        max-height: none;
        padding-bottom: 0.4rem;
        min-width: 0;
    }
}

/* === PRINT === */
@media print {
    body {
        background: #fff;
        color: #232a38;
    }
    header,
    .dark-mode-toggle,
    .hamburger-menu,
    footer::before {
        display: none;
    }
    .page-card,
    .testimonial-card,
    .gallery-item {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    footer {
        background: #fff;
        color: #232a38;
        padding-top: 0;
    }
}

/* === PLACEHOLDER COMPOSITIONS (v1.0.2) ===
   An unprinted plate: the vermilion sun, wave arcs, slanted rain and a
   kumo cloud; the print drifts gently under the hand. */
.page-card-placeholder span { display: none; }

.page-card-placeholder {
    position: relative;
    overflow: hidden;
    background: var(--uk-paper-raised);
}

.page-card-placeholder::before,
.page-card-placeholder::after {
    content: '';
    position: absolute;
    animation: none;
    -webkit-mask-image: none;
    mask-image: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    filter: none;
    opacity: 1;
    width: auto;
    height: auto;
    inset: auto;
    transition: transform 0.6s ease;
}

/* Composition 1: sun disc over wave arcs */
.page-card-placeholder::before {
    inset: 0;
    background:
        radial-gradient(circle at 66% 32%, var(--uk-vermilion) 0 13%, transparent 13.8%),
        radial-gradient(circle at 24% 118%,
            transparent 0 42%, var(--uk-indigo) 42% 43.4%, transparent 43.4% 54%,
            var(--uk-indigo) 54% 55.4%, transparent 55.4% 66%,
            var(--uk-indigo) 66% 67.4%, transparent 67.4%);
    opacity: 0.9;
}

.page-card-placeholder::after {
    width: 120px;
    height: 26px;
    top: 16%;
    left: 12%;
    background-image: var(--uk-kumo);
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.65;
}

/* Composition 2: bokashi band + hanko */
.page-card:nth-child(2n) .page-card-placeholder::before {
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--uk-indigo) 42%, transparent) 0,
            color-mix(in srgb, var(--uk-indigo) 16%, transparent) 34%,
            transparent 62%),
        radial-gradient(circle at 50% 64%,
            transparent 0 17%, var(--uk-ink) 17% 18%, transparent 18%);
}

.page-card:nth-child(2n) .page-card-placeholder::after {
    width: 22px;
    height: 22px;
    top: auto;
    left: auto;
    bottom: 18%;
    right: 16%;
    background: var(--uk-vermilion);
    border-radius: 2px;
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--uk-paper) 60%, transparent);
    transform: rotate(-7deg);
    opacity: 1;
}

/* Composition 3: slanted rain over a low moon */
.page-card:nth-child(3n) .page-card-placeholder::before {
    background:
        repeating-linear-gradient(112deg,
            transparent 0 16px, var(--uk-indigo) 16px 17px) 0 0 / 74% 64% no-repeat,
        radial-gradient(circle at 76% 72%, var(--uk-vermilion) 0 9%, transparent 9.8%);
    opacity: 0.8;
}

.page-card:nth-child(3n) .page-card-placeholder::after {
    width: 56%;
    height: 3px;
    bottom: 20%;
    left: 12%;
    top: auto;
    background: linear-gradient(90deg,
        transparent 0, var(--uk-ink) 14%, var(--uk-ink) 84%, transparent 100%);
    border-radius: 999px;
    transform: rotate(-1deg);
    opacity: 0.85;
}

.page-card:hover .page-card-placeholder::before {
    transform: translateX(-5px) scale(1.04);
}

.page-card:hover .page-card-placeholder::after {
    transform: translate(7px, -4px);
}

@media (prefers-reduced-motion: reduce) {
    .page-card-placeholder::before,
    .page-card-placeholder::after {
        transition: none !important;
    }
}

/* === HERO BACKGROUND IMAGE (6.3.3) ===
   Ukiyo prints a bokashi gradient - woodblock indigo bleeding from the top edge. Content centered, four overlay levels. Overrides the engine's
   universal fallback (loaded earlier) by cascade order. No image set ->
   this block stays inert. */
.hero--has-bg {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 55vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5.2rem 1.5rem 3.6rem;
    background: #1a1f3a;
}

.hero--has-bg .hero-bg-media {
    position: absolute;
    inset: 0;
    z-index: -2;
    display: block;
}

.hero--has-bg .hero-bg-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero--has-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(26,31,72,0.68) 0%, rgba(26,31,72,0.22) 45%, rgba(0,0,0,0.42) 100%);
}

.hero--has-bg h1 {
    color: #fff;
    -webkit-text-fill-color: #fff;
    background: none;
    text-shadow: 0 2px 14px rgba(10,12,40,0.7);
    max-width: 22ch;
}

.hero--overlay-none::after   { background: linear-gradient(180deg, rgba(26,31,72,0.4) 0%, transparent 45%, rgba(0,0,0,0.1) 100%); }
.hero--overlay-light::after  { background: linear-gradient(180deg, rgba(26,31,72,0.55) 0%, rgba(26,31,72,0.12) 45%, rgba(0,0,0,0.26) 100%); }
.hero--overlay-medium::after { background: linear-gradient(180deg, rgba(26,31,72,0.68) 0%, rgba(26,31,72,0.22) 45%, rgba(0,0,0,0.42) 100%); }
.hero--overlay-strong::after { background: linear-gradient(180deg, rgba(26,31,72,0.8) 0%, rgba(26,31,72,0.36) 45%, rgba(0,0,0,0.58) 100%); }
