:root {
    --bg: #f6f1ea;
    --surface: #fffdf9;
    --text: #2b2622;
    --muted: #6b625a;
    --accent: #a07c4f;
    --line: #d9cfc2;
    --ph-1: #e7ddd0;
    --ph-2: #d6c7b4;
    --serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
    --bg: #161412;
    --surface: #1f1c19;
    --text: #efe7dc;
    --muted: #a99f93;
    --accent: #c9a26f;
    --line: #3a342e;
    --ph-1: #2a2622;
    --ph-2: #3a332c;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-weight: 300;
    line-height: 1.75;
    transition: background .4s, color .4s;
}

a { color: inherit; }

/* ---------- Header ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 4vw;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}

.logo { font-family: var(--serif); font-size: 1.8rem; font-style: italic; text-decoration: none; }
.logo span { color: var(--accent); }

nav { display: flex; gap: 2.5rem; }
nav a {
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .2em;
    font-size: .75rem;
    font-weight: 400;
    position: relative;
}
nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width .3s;
}
nav a:hover::after { width: 100%; }

.controls { display: flex; gap: .5rem; }
.controls button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    font: 400 .8rem var(--sans);
    cursor: pointer;
    transition: border-color .3s, color .3s;
}
.controls button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Common ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 0 4vw; }
section { padding: 6rem 0; }

.section-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    text-align: center;
    margin: 0 0 3.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.section-title::before,
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-title.left { text-align: left; }
.section-title.left::before { display: none; }

.btn {
    display: inline-block;
    padding: .9rem 2.2rem;
    border: 1px solid var(--text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .2em;
    font-size: .75rem;
    font-weight: 400;
    transition: background .3s, color .3s;
}
.btn:hover { background: var(--text); color: var(--bg); }

.placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 220px;
    background: linear-gradient(135deg, var(--ph-1), var(--ph-2));
    color: var(--muted);
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.2rem;
}

/* ---------- Hero ---------- */
.hero {
    min-height: 78vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.kicker {
    text-transform: uppercase;
    letter-spacing: .4em;
    font-size: .75rem;
    color: var(--accent);
    margin: 0 0 1.5rem;
}
.hero h1 {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(2.8rem, 8vw, 6rem);
    line-height: 1.05;
    margin: 0;
}
.hero h1 em { display: block; color: var(--accent); font-style: normal; }
.rule { width: 80px; height: 1px; background: var(--accent); margin: 2.5rem auto; }
.lead { max-width: 560px; color: var(--muted); font-size: 1.1rem; margin: 0 0 2.5rem; }

/* ---------- Services ---------- */
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}
.service-grid article { text-align: center; padding: 0 1rem; }
.num {
    font-family: var(--serif);
    font-style: italic;
    color: var(--accent);
    font-size: 1.6rem;
}
.service-grid h3 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.4rem;
    margin: .5rem 0 1rem;
}
.service-grid p { color: var(--muted); margin: 0; }

/* ---------- Work / gallery ---------- */
.filters {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}
.filters button {
    background: none;
    border: none;
    border-bottom: 1px solid transparent;
    color: var(--muted);
    font: 400 .75rem var(--sans);
    letter-spacing: .2em;
    text-transform: uppercase;
    padding: .3rem 0;
    cursor: pointer;
}
.filters button:hover,
.filters button.active { color: var(--text); border-bottom-color: var(--accent); }

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 260px;
    grid-auto-flow: dense;
    gap: 1.25rem;
}
.item {
    position: relative;
    margin: 0;
    overflow: hidden;
    background: var(--surface);
    cursor: zoom-in;
}
.item.tall { grid-row: span 2; }
.item.wide { grid-column: span 2; }
.item.hidden { display: none; }
.item img,
.item .placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s ease;
}
.item:hover img,
.item:hover .placeholder { transform: scale(1.05); }
.item figcaption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    background: linear-gradient(transparent, rgba(0, 0, 0, .6));
    color: #fff;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .4s, transform .4s;
}
.item img { object-position: top; }
.item:hover figcaption { opacity: 1; transform: none; }
.item figcaption strong { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; }
.item figcaption span { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; }

/* ---------- About ---------- */
.about {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 4rem;
    align-items: center;
}
.portrait {
    aspect-ratio: 4 / 5;
    outline: 1px solid var(--accent);
    outline-offset: 14px;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about p { color: var(--muted); }
.skills {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}
.skills li {
    border: 1px solid var(--line);
    padding: .35rem 1rem;
    font-size: .8rem;
    letter-spacing: .1em;
}

/* ---------- Contact / footer ---------- */
.contact { text-align: center; }
.contact p { color: var(--muted); margin: 0 0 2rem; }

.footer {
    text-align: center;
    padding: 2.5rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .85rem;
}
.footer a { color: var(--accent); }

/* ---------- Business card ---------- */
.bizcard-wrap { margin-top: 3rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.bizcard {
    width: 360px;
    max-width: 100%;
    height: 210px;
    perspective: 1200px;
    cursor: pointer;
    outline: none;
    text-align: left;
}
.bizcard-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transition: transform .7s cubic-bezier(.2, .8, .2, 1);
    transform-style: preserve-3d;
}
.bizcard.open .bizcard-inner { transform: rotateY(180deg); }
.bizcard:focus-visible .bizcard-face { outline: 2px solid var(--accent); outline-offset: 4px; }
.bizcard-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .4rem;
    padding: 1.75rem 2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 1px 0 var(--line), 8px 8px 0 -1px var(--bg), 8px 8px 0 0 var(--line), 0 18px 40px rgba(0, 0, 0, .12);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.bizcard-face::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid var(--accent);
    opacity: .35;
    pointer-events: none;
}
.bizcard-back { transform: rotateY(180deg); }
.bc-name { font-size: 1.4rem; font-weight: 400; letter-spacing: .08em; }
.bc-title { color: var(--accent); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; }
.bc-hint { margin-top: 1.25rem; color: var(--muted); font-size: .8rem; }
.bizcard-back .bc-name { margin-bottom: .6rem; }
.bc-row { display: flex; align-items: baseline; gap: 1rem; font-size: .95rem; }
.bc-label { width: 4.5rem; color: var(--accent); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; }
.bc-row a { text-decoration: none; position: relative; z-index: 1; }
.bc-row a:hover { color: var(--accent); }
.bc-save { color: var(--muted); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; }
.bc-save::before { content: "\2913  "; }
.bc-save:hover { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .bizcard-inner { transition: none; } }

/* Floral decoration */
.bizcard { width: 380px; height: 225px; }
.bizcard-face { overflow: hidden; }
.bizcard-front {
    justify-content: flex-end;
    background: url("images/floral-corner.svg") right -18px top -14px / 64% auto no-repeat, var(--surface);
}
.bizcard-back {
    justify-content: flex-end;
    gap: .3rem;
    padding-top: 4.5rem;
    background: url("images/floral-corner.svg") right -22px top -38px / 52% auto no-repeat, var(--surface);
}
.bizcard-back::after {
    content: "";
    position: absolute;
    top: -38px;
    left: -22px;
    width: 52%;
    aspect-ratio: 240 / 200;
    background: url("images/floral-corner.svg") center / contain no-repeat;
    transform: scaleX(-1);
    pointer-events: none;
}
.bc-mono {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    margin-bottom: .5rem;
    border: 1px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.05rem;
    letter-spacing: .05em;
}
.bizcard-front .bc-name { font-family: var(--serif); font-size: 1.6rem; letter-spacing: .03em; }
.bizcard-front .bc-hint { margin-top: .6rem; }
.bizcard-back .bc-name { font-family: var(--serif); margin-bottom: .3rem; }
.bizcard-back .bc-row { position: relative; z-index: 1; }
@media (max-width: 420px) {
    .bizcard { height: 215px; }
    .bizcard-front { background-size: 58% auto; }
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 9, 8, .92);
    padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 82vh; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox .caption { color: #efe7dc; font-family: var(--serif); font-style: italic; margin-top: 1rem; }
.lightbox .close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .service-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .gallery { grid-template-columns: repeat(2, 1fr); }
    .about { grid-template-columns: 1fr; }
    .portrait { max-width: 380px; margin: 0 auto; }
}

@media (max-width: 640px) {
    nav { display: none; }
    section { padding: 4rem 0; }
    .gallery { grid-template-columns: 1fr; grid-auto-rows: 240px; }
    .item.wide { grid-column: auto; }
    .item figcaption { opacity: 1; transform: none; }
}


/* ---------- Project collections ---------- */
.projects {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 2.5rem 2rem;
}
.project { cursor: pointer; outline: none; display: flex; flex-direction: column; }
.project.hidden { display: none; }
.project-cover {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--surface);
	border: 1px solid var(--line);
	box-shadow: 0 1px 0 var(--line), 6px 6px 0 -1px var(--surface), 6px 6px 0 0 var(--line);
}
.project-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	transition: transform .6s ease, filter .6s ease;
}
.project:hover .project-cover img,
.project:focus-visible .project-cover img { transform: scale(1.04); filter: brightness(.92); }
.project:focus-visible .project-cover { outline: 2px solid var(--accent); outline-offset: 4px; }
.project-count {
	position: absolute;
	right: .8rem;
	bottom: .8rem;
	padding: .25rem .65rem;
	font-size: .75rem;
	letter-spacing: .1em;
	color: #fff;
	background: rgba(20, 17, 14, .65);
	backdrop-filter: blur(4px);
	border-radius: 999px;
}
.project-count::before { content: "\25A3  "; }
.project-info { order: -1; padding-bottom: 1rem; }
.project-cat { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.project-info h3 { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; margin: .3rem 0 .15rem; }
.project-client { color: var(--muted); font-size: .9rem; margin: 0; }

/* Lightbox – project viewer */
.lightbox {
	display: grid;
	grid-template-columns: 4rem 1fr 4rem;
	grid-template-rows: 1fr auto auto;
	align-items: center;
	justify-items: center;
	padding: 2rem 1rem 1rem;
	gap: .5rem;
}
.lightbox[hidden] { display: none; }
.lightbox .lb-stage { grid-column: 2; grid-row: 1; margin: 0; display: grid; place-items: center; min-height: 0; height: 100%; }
.lightbox .lb-stage img { max-width: 100%; max-height: 68vh; object-fit: contain; }
.lightbox .nav {
	grid-row: 1;
	width: 3rem; height: 3rem;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .35);
	background: rgba(255, 255, 255, .08);
	color: #fff;
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
}
.lightbox .nav:hover { background: rgba(255, 255, 255, .2); }
.lightbox .prev { grid-column: 1; }
.lightbox .next { grid-column: 3; }
.lightbox.single .nav, .lightbox.single .lb-thumbs, .lightbox.single .lb-counter { display: none; }
.lightbox .lb-meta { grid-column: 1 / -1; text-align: center; color: #efe7dc; max-width: 60ch; }
.lightbox .lb-meta .caption { margin: .5rem 0 .2rem; font-size: 1.4rem; font-weight: 400; }
.lightbox .lb-desc { margin: 0; color: #c9bfb2; font-size: .95rem; }
.lightbox .lb-counter { display: inline-block; margin-top: .3rem; font-size: .75rem; letter-spacing: .2em; color: #a99f93; }
.lightbox .lb-thumbs {
	grid-column: 1 / -1;
	display: flex;
	gap: .5rem;
	max-width: 100%;
	overflow-x: auto;
	padding: .5rem;
}
.lightbox .lb-thumbs img {
	width: 72px; height: 54px;
	object-fit: cover;
	opacity: .45;
	cursor: pointer;
	border: 2px solid transparent;
	flex: none;
	transition: opacity .2s;
}
.lightbox .lb-thumbs img:hover { opacity: .8; }
.lightbox .lb-thumbs img.active { opacity: 1; border-color: var(--accent); }
@media (max-width: 640px) {
	.projects { grid-template-columns: 1fr; }
	.lightbox { grid-template-columns: 2.5rem 1fr 2.5rem; }
	.lightbox .nav { width: 2.3rem; height: 2.3rem; font-size: 1.3rem; }
}

/* QR code on card back */
.bc-qr { position: absolute; right: 1.2rem; bottom: 1.2rem; width: 76px; height: 76px; padding: 4px; background: #fff; border: 1px solid var(--line); z-index: 1; }
.bizcard-back { padding-right: 7rem; }
@media (max-width: 420px) { .bc-qr { width: 62px; height: 62px; } .bizcard-back { padding-right: 5.8rem; } }
