:root {
  --bg: #F4F7F7;
  --surface: #E5EDEF;
  --surface-2: #CFDDE1;
  --field: #FFFFFF;
  --text: #16262B;
  --muted: #586A70;
  --accent: #1D5E70;        /* the teal of the printed portfolio */
  --accent-hover: #164B5A;
  --accent-ink: #FFFFFF;
  --chip: #D7E7EC;
  --chip-ink: #154655;
  --danger: #A33A2B;
  --banner-ink: #E3EEF1;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pad: clamp(1rem, 4vw, 3rem);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }

/* banner: the teal strip from the printed portfolio */
.banner { background: linear-gradient(rgba(10, 45, 57, .28), rgba(10, 45, 57, .28)), #1D5E70 url(/banner.jpg) center / cover; color: var(--banner-ink); }
.banner :focus-visible { outline-color: #fff; }
.banner-inner { max-width: 1200px; margin: 0 auto; padding: 1rem var(--pad); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem; }
.banner.tall .banner-inner { align-items: flex-end; padding-top: clamp(2.5rem, 8vw, 5rem); padding-bottom: clamp(2rem, 6vw, 3.5rem); }
.brand { font-family: var(--serif); font-weight: 400; text-transform: uppercase; letter-spacing: .28em; text-decoration: none; line-height: 1.3; font-size: 1rem; }
.banner.tall .brand { font-size: clamp(1.6rem, 4.4vw, 2.8rem); }
.banner.tall .brand span { display: block; }
#nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
#nav a, #nav button { color: var(--banner-ink); background: none; border: 0; cursor: pointer; text-decoration: none; padding: .4rem .8rem; border-radius: 999px; font-size: .95rem; }
#nav a:hover, #nav button:hover { background: rgba(255, 255, 255, .16); }
#nav .strong { background: rgba(255, 255, 255, .2); }

main { max-width: 1200px; margin: 0 auto; padding: 0 var(--pad) 5rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 0; cursor: pointer;
  border-radius: 999px; padding: .55rem 1.1rem; background: var(--surface); text-decoration: none; font-weight: 500; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.small { padding: .3rem .75rem; font-size: .9rem; }
.btn[disabled] { opacity: .45; cursor: default; }

/* home */
.intro { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.intro h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 500; max-width: 28ch; }
.portrait { flex: none; width: clamp(6.5rem, 16vw, 10.5rem); aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.category { margin-bottom: 3.5rem; }
.category > h2 { font-size: 1.8rem; }
.category > .sub { color: var(--muted); margin: .2rem 0 0; }
.category > .grid, .category > .note { margin-top: 1.1rem; }
.grid { display: grid; gap: 1.6rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); }
.card { display: block; text-decoration: none; }
.card .ph { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card h3 { font-size: 1.15rem; margin-top: .6rem; }
.card:hover h3 { text-decoration: underline; text-underline-offset: .2em; }
.meta { color: var(--muted); font-size: .9rem; margin: .15rem 0 0; }
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--serif); font-size: 2.6rem; color: var(--muted); }
.note { color: var(--muted); }
.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: .5rem; }
.empty .btn { margin-top: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-block; background: var(--chip); color: var(--chip-ink); padding: .15rem .65rem; border-radius: 8px; font-size: .9rem; font-weight: 500; }

.about { border-top: 2px solid var(--surface-2); padding-top: 2rem; }
.about h2 { font-size: 1.8rem; margin-bottom: 1rem; }
.about-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .about-grid { grid-template-columns: 3fr 2fr; } }
.about .text { max-width: 62ch; font-family: var(--serif); font-size: 1.1rem; line-height: 1.65; }
.about .chips { margin-top: 1rem; }
.contact dt { color: var(--muted); font-size: .9rem; }
.contact dd { margin: 0 0 1rem; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.contact a { text-underline-offset: .2em; }

/* project page */
.back { display: inline-block; margin: 1.4rem 0 .8rem; color: var(--muted); }
.back:hover { color: var(--text); }
.project-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.project-head h1 { font-size: clamp(2rem, 5vw, 3rem); }
.project-head .meta { font-size: 1.05rem; margin-top: .35rem; }
.tools { display: flex; flex-wrap: wrap; gap: .4rem; }
.shot, .hero { display: block; width: 100%; padding: 0; border: 0; background: var(--surface); cursor: zoom-in; border-radius: var(--radius); overflow: hidden; }
.hero img { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; margin: 0 auto; }
.project-body { display: grid; gap: 2rem; grid-template-columns: 1fr; margin: 2rem 0; }
@media (min-width: 860px) { .project-body.has-story { grid-template-columns: minmax(16rem, 2fr) 3fr; align-items: start; } }
.facts { display: grid; gap: 1.2rem; margin: 0; }
.facts dt { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; margin-bottom: .4rem; }
.facts dd { margin: 0; }
.story { font-family: var(--serif); font-size: 1.12rem; line-height: 1.7; max-width: 62ch; }
.gallery { columns: 3 16rem; column-gap: 1rem; margin-top: 1rem; }
.gallery figure { margin: 0 0 1rem; break-inside: avoid; }
.shot img { display: block; width: 100%; height: auto; }
figcaption { color: var(--muted); font-size: .92rem; padding-top: .35rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 2px solid var(--surface-2); }
.pager a { text-decoration: none; max-width: 48%; }
.pager a:hover strong { text-decoration: underline; text-underline-offset: .2em; }
.pager small { display: block; color: var(--muted); }
.pager strong { font-family: var(--serif); font-size: 1.1rem; }
.pager .next { text-align: right; margin-left: auto; }

/* lightbox */
dialog.lightbox { border: 0; padding: 0; background: transparent; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; color: #fff; }
dialog.lightbox::backdrop { background: rgba(8, 20, 25, .92); }
.lb { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: .6rem; padding: 3.5rem 1rem 1rem; position: relative; }
.lb img { max-width: 100%; max-height: 100%; width: auto; height: auto; margin: auto; display: block; object-fit: contain; min-height: 0; }
.lb .cap { text-align: center; min-height: 1.5em; color: #D5E3E7; }
.lb button { position: absolute; background: rgba(255, 255, 255, .16); color: #fff; border: 0; border-radius: 50%; width: 2.8rem; height: 2.8rem; font-size: 1.3rem; cursor: pointer; }
.lb button:hover { background: rgba(255, 255, 255, .3); }
.lb button:focus-visible { outline-color: #fff; }
.lb .close { top: .8rem; right: .8rem; }
.lb .prev, .lb .next { top: 50%; transform: translateY(-50%); }
.lb .prev { left: .8rem; }
.lb .next { right: .8rem; }

/* forms */
.form { max-width: 52rem; display: grid; gap: 1.2rem; margin-top: 1.5rem; }
.form h1 { font-size: 2rem; }
.field { display: grid; gap: .3rem; }
.field > label, .legend { font-weight: 600; font-size: .95rem; }
.hint { color: var(--muted); font-size: .88rem; font-weight: 400; }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%; padding: .6rem .8rem; border: 2px solid var(--surface-2); border-radius: 8px; background: var(--field); }
textarea { min-height: 7rem; resize: vertical; }
.row { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.photos { display: grid; gap: .6rem; }
.photo-row { display: grid; grid-template-columns: 6.5rem 1fr; gap: .8rem; background: var(--surface); padding: .6rem; border-radius: var(--radius); align-items: start; }
.photo-row img { width: 6.5rem; height: 5rem; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.photo-fields { display: grid; gap: .5rem; min-width: 0; }
.photo-fields .chip { width: fit-content; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.error { background: #F7DDD6; color: #7C2418; padding: .7rem 1rem; border-radius: 8px; }
.login { max-width: 24rem; margin: 3rem auto; display: grid; gap: 1rem; }
.sec-row { display: grid; gap: .5rem; background: var(--surface); padding: .8rem; border-radius: var(--radius); }
.sec-list { display: grid; gap: .8rem; }
.profile-photo { width: 8rem; height: 8rem; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .6rem 1.2rem; border-radius: 999px; z-index: 20; }

@media (max-width: 600px) { .intro { flex-direction: column-reverse; align-items: flex-start; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }
