@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,520;9..144,640&family=Outfit:wght@340;480;580&display=swap");

:root,
[data-theme="ivory"] {
    --bg: #f3eee6;
    --paper: #faf7f2;
    --ink: #1e1a16;
    --muted: #6e655c;
    --accent: #9d3b2f;
    --accent-ink: #fff8f4;
    --line: rgba(30, 26, 22, 0.14);
    --shadow: 0 24px 60px rgba(60, 36, 20, 0.08);
    --side: #1c1915;
    --side-ink: #f4efe6;
    --danger: #9d3b2f;
    --ok: #2f6b4f;
    --radius: 18px;
    --font: "Outfit", "Avenir Next", sans-serif;
    --display: "Fraunces", "Iowan Old Style", Georgia, serif;
    --max: 1180px;
}
[data-theme="obsidian"] {
    --bg: #14120e;
    --paper: #1d1a15;
    --ink: #f3ecdf;
    --muted: #b1a89a;
    --accent: #d7a15f;
    --accent-ink: #1a140c;
    --line: rgba(243, 236, 223, 0.14);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    --side: #0e0c0a;
    --side-ink: #f4efe6;
}
[data-theme="lagoon"] {
    --bg: #082220;
    --paper: #103532;
    --ink: #e7f3f0;
    --muted: #9db8b2;
    --accent: #ee7a57;
    --accent-ink: #1a100c;
    --line: rgba(231, 243, 240, 0.16);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    --side: #041614;
    --side-ink: #e7f3f0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.55;
    font-weight: 340;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button, [role="button"], .btn { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 560; letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
p { margin: 0 0 0.8rem; }
::selection { background: var(--accent); color: var(--accent-ink); }

.skip {
    position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--bg);
    padding: 0.6rem 0.8rem; z-index: 20;
}
.skip:focus { top: 1rem; }

.kicker {
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 0.7rem;
}
.lede { font-size: 1.15rem; max-width: 42rem; color: var(--muted); }

.site-header {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.9rem 4vw;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; font-weight: 580; }
.brand img { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; }
.brand span { font-family: var(--display); font-size: 1.25rem; }
.nav { display: flex; gap: 1.1rem; align-items: center; }
.nav a { text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--accent); }
button.nav-toggle, button.side-burger { display: none !important; }
.btn, button.btn, a.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    background: var(--accent); color: var(--accent-ink); text-decoration: none;
    border: 0; border-radius: 999px; padding: 0.75rem 1.15rem; min-height: 44px;
    font-weight: 580; position: relative;
}
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-small { padding: 0.45rem 0.8rem; min-height: 38px; font-size: 0.92rem; }
.btn.is-loading { color: transparent; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 1rem; height: 1rem; border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--accent-ink) 35%, transparent);
    border-top-color: var(--accent-ink); animation: spin 0.7s linear infinite;
}
.btn-ghost.is-loading::after { border-top-color: var(--ink); border-color: var(--line); }

.hero { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 3rem; padding: 4.5rem 4vw 3rem; align-items: end; max-width: 1440px; margin: 0 auto; }
.hero h1 { font-size: clamp(3.4rem, 8vw, 7.4rem); max-width: 10ch; }
.hero-copy { max-width: 38rem; font-size: 1.12rem; }
.hero-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.4rem; }
.portrait { position: relative; }
.portrait img, .portrait .ph {
    width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 28px 28px 80px 28px;
    background: var(--paper); border: 1px solid var(--line);
}
.portrait figcaption { margin-top: 0.7rem; color: var(--muted); font-size: 0.92rem; }
.avail { display: flex; justify-content: space-between; gap: 1rem; margin: 0 4vw 2rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }

.section { padding: 3.5rem 4vw; max-width: 1440px; margin: 0 auto; }
.section-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1.6rem; }
.section h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
.service-row, .cv-row, .achieve {
    display: grid; grid-template-columns: 4rem 1fr 1.3fr; gap: 1rem;
    padding: 1.15rem 0; border-top: 1px solid var(--line); text-decoration: none;
}
.service-row strong, .cv-row strong { font-size: 1.25rem; font-family: var(--display); font-weight: 560; }
.index-no { color: var(--accent); font-variant-numeric: tabular-nums; }
.work-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; }
.work-card { display: block; text-decoration: none; background: var(--paper); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.work-card img, .work-card .ph { aspect-ratio: 16/11; width: 100%; object-fit: cover; background: color-mix(in srgb, var(--accent) 18%, var(--paper)); }
.work-card div { padding: 1rem 1.1rem 1.2rem; }
.work-card:first-child { grid-row: span 2; }
.work-card:first-child img, .work-card:first-child .ph { aspect-ratio: 4/5; }
.meta { color: var(--muted); font-size: 0.92rem; }
.article-grid, .card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.ticket-stack { display: grid; gap: 0.8rem; }
.ticket-stack form { margin: 0; }
.story, .panel, .quote, .stat, .gift {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem 1.2rem;
}
.story { text-decoration: none; display: flex; flex-direction: column; min-height: 100%; }
.story img, .cover { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 12px; background: color-mix(in srgb, var(--accent) 16%, var(--paper)); }
.story h3, .panel h3 { font-size: 1.45rem; margin: 0.7rem 0; }
.quote q { font-family: var(--display); font-size: 1.35rem; line-height: 1.25; display: block; margin-bottom: 0.8rem; }
.gallery-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.6rem; }
.gallery-strip a, .gallery-grid a, .gallery-grid figure { margin: 0; }
.gallery-strip img, .gallery-grid img, .gallery-grid video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.prose { max-width: 42rem; }
.prose h2 { font-size: 2rem; margin: 1.6rem 0 0.6rem; }
.prose blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 2px solid var(--accent); }
.prose img, .prose video { border-radius: 12px; margin: 1rem 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2rem; padding: 2.5rem 4vw 4rem; max-width: 1440px; margin: 0 auto; }
.page-intro { padding: 3rem 4vw 0; max-width: 1440px; margin: 0 auto; }
.page-intro h1 { font-size: clamp(2.8rem, 6vw, 5.2rem); max-width: 14ch; }
.tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.8rem 0; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.82rem; text-decoration: none; color: var(--muted); }
.comment { padding: 0.9rem 0; border-top: 1px solid var(--line); }
.site-footer { padding: 2rem 4vw 3rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); }
.site-footer a { color: var(--ink); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 1rem; }
.span-2 { grid-column: span 2; }
label { display: grid; gap: 0.35rem; font-size: 0.92rem; color: var(--muted); }
input, textarea, select {
    width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
    padding: 0.75rem 0.8rem; min-height: 46px; outline: none;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.checkline { display: flex; align-items: center; gap: 0.55rem; color: var(--ink); }
.checkline input { width: auto; min-height: 0; }
.note { color: var(--muted); }
.note.bad, .bad { color: var(--danger); }
.row-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }

.demo-ribbon {
    background: var(--ink); color: var(--bg); text-align: center; padding: 0.45rem 1rem; font-size: 0.88rem;
}
.bday-banner { margin: 1rem 4vw 0; padding: 0.9rem 1rem; border-radius: 14px; background: var(--accent); color: var(--accent-ink); display: flex; justify-content: space-between; gap: 1rem; align-items: center; text-decoration: none; }
.demo-card, .auth-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.auth-layout { max-width: 920px; margin: 0 auto; padding: 3rem 4vw 4rem; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.2rem; align-items: start; }
.auth-layout h1 { font-size: clamp(2.6rem, 5vw, 4.4rem); margin-bottom: 0.8rem; }

.progress-modal[hidden], [hidden] { display: none !important; }
.progress-modal {
    position: fixed; inset: 0; background: rgba(16, 12, 8, 0.46); display: grid; place-items: center; z-index: 70; padding: 1rem;
}
.progress-card { width: min(440px, 100%); background: var(--paper); color: var(--ink); border-radius: 20px; padding: 1.2rem; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 1%; background: var(--accent); }
#ib-toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: 0.6rem; z-index: 80; width: min(380px, calc(100% - 2rem)); }
.toast { background: var(--ink); color: var(--bg); border-radius: 16px; padding: 0.85rem 0.95rem; box-shadow: var(--shadow); }
.toast strong { display: block; font-family: var(--display); font-size: 1.15rem; }
.toast p { margin: 0.2rem 0 0; color: color-mix(in srgb, var(--bg) 78%, transparent); }
.toast.success { background: var(--ok); color: white; }
.toast.error { background: var(--danger); color: white; }
.confirm-modal { position: fixed; inset: 0; background: rgba(16,12,8,.46); display: grid; place-items: center; z-index: 85; padding: 1rem; }
.confirm-card { width: min(440px, 100%); background: var(--paper); border-radius: 20px; padding: 1.2rem; }

.editor { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--paper); }
.editor-bar { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.45rem; border-bottom: 1px solid var(--line); }
.editor-bar button { border: 0; background: transparent; min-width: 36px; min-height: 36px; border-radius: 8px; }
.editor-bar button:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.editor-area { min-height: 240px; padding: 0.9rem 1rem; outline: none; }
.editor-area:focus { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }

.shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); background: var(--bg); }
.side {
    background: var(--side); color: var(--side-ink); padding: 1rem 0.8rem 1.2rem;
    position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column;
}
.side a { color: inherit; text-decoration: none; display: flex; gap: 0.65rem; align-items: center; padding: 0.55rem 0.7rem; border-radius: 10px; min-height: 44px; }
.side a.is-on, .side a:hover { background: color-mix(in srgb, white 8%, transparent); }
.side .group { margin: 0.9rem 0.7rem 0.3rem; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: color-mix(in srgb, var(--side-ink) 55%, transparent); }
.side-foot { margin-top: auto; display: grid; gap: 0.4rem; }
.side-collapse {
    position: sticky; top: 0; z-index: 2;
    width: calc(100% - 0.3rem);
    margin: 0 0.15rem 0.75rem;
    background: var(--side);
}
.side-foot .btn, .side [data-side-toggle] { color: var(--side-ink); border-color: color-mix(in srgb, var(--side-ink) 35%, transparent); }
.workspace { padding: 1rem 1.2rem 3rem; min-width: 0; }
.backdrop { display: none; }
.workspace-top { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.75rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.95rem; }
th { color: var(--muted); font-weight: 480; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.theme-pick label { color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 0.8rem; }
.theme-pick input { margin-bottom: 0.4rem; }
.swatch { height: 64px; border-radius: 10px; margin-bottom: 0.5rem; }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.pager { display: flex; gap: 0.4rem; margin-top: 1rem; }
.pager a, .pager span { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.7rem; }

.install-body { min-height: 100vh; }
.install-wrap { max-width: 860px; margin: 0 auto; padding: 3rem 1.2rem 4rem; }
.install-card { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 1.2rem; box-shadow: var(--shadow); }
.steps { display: flex; gap: 0.8rem; padding: 0; list-style: none; color: var(--muted); font-size: 0.88rem; flex-wrap: wrap; }
.steps .is-on { color: var(--ink); }
.check-list { list-style: none; padding: 0; display: grid; gap: 0.35rem; }
.check-list li::before { content: "– "; }
.check-list .ok::before { content: "OK "; color: var(--ok); font-weight: 580; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.choice { background: var(--bg); border-radius: 16px; padding: 0.9rem; border: 1px solid var(--line); }
.choice small { display: block; color: var(--muted); }
.lockdown, .pause-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.lockdown article, .pause-page article { max-width: 640px; }
.colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.6rem; }
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.7,.2,1); }
.rise { animation: rise 0.9s cubic-bezier(.2,.7,.2,1) both; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

.shell.is-min { grid-template-columns: 88px minmax(0, 1fr); }
.shell.is-min .side .label, .shell.is-min .side .group, .shell.is-min .brand span { display: none; }
.shell.is-min .side a { justify-content: center; }
.shell.is-min .side-collapse { font-size: 0.68rem; line-height: 1.15; padding: 0.4rem 0.2rem; white-space: normal; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; }

@media (min-width: 981px) {
    .shell > .side { grid-column: 1; grid-row: 1; }
    .shell > .workspace { grid-column: 2; grid-row: 1; }
    .shell > .backdrop, .side-burger { display: none !important; }
}
@media (max-width: 980px) {
    .hero, .work-grid, .article-grid, .card-grid, .auth-layout, .layout, .choice-grid, .stats, .theme-pick { grid-template-columns: 1fr; }
    .gallery-strip { grid-template-columns: repeat(3, 1fr); }
    .service-row, .cv-row, .achieve { grid-template-columns: 3rem 1fr; }
    .service-row span:last-child, .cv-row span:last-child { grid-column: 2; }
    .colors { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .nav-toggle, .side-burger { display: inline-flex; }
    button.nav-toggle, button.side-burger { display: inline-flex !important; }
    [data-side-toggle], button[data-side-toggle] { display: none !important; }
    .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 0.8rem 4vw 1rem; flex-direction: column; align-items: flex-start; }
    .site-header { position: sticky; }
    .site-header.is-open .nav { display: flex; }
    .shell { grid-template-columns: 1fr; }
    .side { position: fixed; z-index: 40; transform: translateX(-105%); width: min(84vw, 320px); transition: transform 0.2s ease; }
    .shell.nav-open .side { transform: none; }
    .shell.is-min { grid-template-columns: 1fr; }
    .shell.is-min .side .label, .shell.is-min .side .group, .shell.is-min .brand span { display: initial; }
    .backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
    .shell.nav-open .backdrop { display: block; }
}
@media (prefers-reduced-motion: reduce) {
    .reveal, .rise { animation: none; opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}
