/* Damjan Obal — static site
   Layout rule: every block (header, page content, footer) sits in the same
   container (--max wide, --gutter padding), so all left edges line up.
   Text is capped at --read for comfortable line length; images, galleries
   and grids may use the full container width. */
:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #6e6e6e;
  --line: #e6e6e6;
  --soft: #f4f4f2;
  --accent: #1a1a1a;
  --max: 1200px;
  --read: 720px;
  --gutter: clamp(16px, 4vw, 48px);
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: clamp(32px, 4.6vw, 52px); letter-spacing: -0.025em; margin: 1.4em 0 0.5em; }
h2 { font-size: clamp(21px, 2.3vw, 26px); margin: 1.9em 0 0.5em; }
h3 { font-size: clamp(18px, 1.9vw, 21px); font-weight: 400; margin: 0.6em 0; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; margin: 0 0 1.4em; }
li { margin-bottom: 0.4em; }
li::marker { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 3em 0; }
blockquote {
  margin: 2em 0; padding: 0 0 0 1.2em; border-left: 3px solid var(--text);
  font-size: clamp(19px, 2vw, 23px); line-height: 1.45; font-style: italic;
}

.skip { position: absolute; left: -9999px; top: 8px; background: #000; color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------------- shared container */
.header-inner, .footer-inner, .wrap, .hub, .home, .project-article {
  width: 100%; max-width: var(--max); margin-left: auto; margin-right: auto;
}
.header-inner, .footer-inner, .wrap, .hub, .home { padding-left: var(--gutter); padding-right: var(--gutter); }

/* text column inside .wrap: left-aligned, capped width */
.wrap > * { max-width: var(--read); }
.wrap > hr, .wrap > figure, .wrap > .gallery, .wrap > .brief, .wrap > .two-col,
.wrap > .logos, .wrap > .pager, .wrap > .cv-grid, .wrap > .page-head { max-width: none; }
.page-top { padding-top: clamp(28px, 5vw, 64px); }

/* ---------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.94); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  padding-top: 18px; padding-bottom: 18px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
}
.site-title { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; text-decoration: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(18px, 4vw, 36px); }
.site-nav li { margin: 0; }
.site-nav a { font-size: 16px; text-decoration: none; padding: 6px 0; color: var(--muted); transition: color .15s; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"], .site-nav a.is-active { color: var(--text); text-decoration: underline; text-underline-offset: 7px; text-decoration-thickness: 2px; }
@media (max-width: 420px) { .site-title { font-size: 18px; } .site-nav a { font-size: 15px; } }

/* ---------------- page head */
.page-head { margin: 0 0 clamp(8px, 2vw, 16px); }
.page-head h1 { margin: 0; }
.eyebrow { margin: 0 0 10px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.eyebrow a { color: var(--muted); text-decoration: none; }
.eyebrow a::before { content: "\2190\00a0"; }
.eyebrow a:hover { color: var(--text); }

/* ---------------- project pages */
main { min-height: 60vh; }
.hero { margin: clamp(16px, 3vw, 32px) var(--gutter) clamp(28px, 4vw, 48px); background: var(--soft); }
.hero img { width: 100%; }

.meta { color: var(--muted); font-size: 15px; line-height: 1.6; }
.meta p { margin: 0.15em 0; }
.meta a { color: var(--muted); }
.wrap > hr:has(+ .meta) { margin: 1.5em 0; }
.meta + hr { margin: 1.5em 0 1em; }

.brief { display: grid; grid-template-columns: 1fr; gap: 0 clamp(32px, 5vw, 64px); }
.brief section { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 1.4em; }
.brief h2 { margin: 0.8em 0 0.4em; font-size: clamp(19px, 2vw, 22px); }
@media (min-width: 820px) { .brief { grid-template-columns: 1fr 1fr; } }
/* the line under the project details already separates the first row */
.meta + hr + .brief section:first-child { border-top: 0; margin-top: 0; }
@media (min-width: 820px) { .meta + hr + .brief section:nth-child(2) { border-top: 0; margin-top: 0; } }

/* section headings inside a page sit one step below the page title */
.wrap > h1 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.02em; margin-top: 1.8em; }

.two-col { display: grid; gap: 0 40px; }
@media (min-width: 700px) { .two-col { grid-template-columns: 1fr 1fr; } }

figure { margin: 2.2em 0; }
figure.img img { width: 100%; }
figcaption, .caption { font-size: 14px; color: var(--muted); margin-top: 0.7em; line-height: 1.5; max-width: var(--read); }
figcaption a { color: var(--muted); }
.zoom img { cursor: zoom-in; }

.gallery { display: grid; gap: 20px; margin: 2.2em 0; grid-template-columns: 1fr; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--soft); }
.gallery figcaption strong { display: block; color: var(--text); font-weight: 600; }
.gallery figcaption span { display: block; }
@media (min-width: 560px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .gallery.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.logos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; align-items: center; margin: 2.2em 0; }
.logos figure { margin: 0; }
.logos img { max-height: 80px; width: auto; margin: 0 auto; object-fit: contain; }
@media (min-width: 700px) { .logos { grid-template-columns: repeat(5, 1fr); } }

.embed { position: relative; aspect-ratio: 595 / 485; margin: 1.5em 0 0.5em; background: var(--soft); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 1px solid var(--line); }
.embed-credit { font-size: 14px; color: var(--muted); }

/* previous / next */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin: clamp(48px, 7vw, 88px) var(--gutter) 0; padding-top: 24px; border-top: 1px solid var(--line);
}
.wrap > .pager { margin-left: 0; margin-right: 0; }
.pager a { text-decoration: none; font-size: clamp(17px, 2vw, 21px); font-weight: 600; line-height: 1.3; }
.pager a span { display: block; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 4px; }
.pager a:hover { text-decoration: underline; text-underline-offset: 4px; }
.pager-next { text-align: right; grid-column: 2; }

.button {
  display: inline-block; margin-top: 0.8em; padding: 14px 28px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: 0.02em;
  transition: background .15s;
}
.button:hover { background: #444; }

/* ---------------- home */
.home {
  display: grid; gap: clamp(28px, 5vw, 72px); align-items: start;
  padding-top: clamp(28px, 5vw, 64px);
}
.home-photo figure { margin: 0; }
.home-text h1 { margin-top: 0; }
@media (min-width: 900px) {
  .home { grid-template-columns: 5fr 7fr; }
  .home-photo { position: sticky; top: 100px; }
}

/* ---------------- hub pages */
.hub { padding-top: clamp(28px, 5vw, 64px); }
.hub h1 { margin: 0 0 clamp(24px, 3.5vw, 44px); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(28px, 3.5vw, 48px) clamp(16px, 2.5vw, 32px); grid-template-columns: 1fr; }
.cards li { margin: 0; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { display: block; text-decoration: none; }
.card-img { display: block; aspect-ratio: 1440 / 500; overflow: hidden; background: var(--soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-img img { transform: scale(1.03); }
/* black & white until hovered or focused; touch screens (no hover) always show colour */
@media (hover: hover) {
  .card-img img { filter: grayscale(1); transition: transform .4s ease, filter .35s ease; }
  .card:hover .card-img img, .card:focus-visible .card-img img { filter: none; }
}
.card-blank { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 26px; font-weight: 600; background: #ececea; }
.card-body { display: block; padding-top: 14px; }
.card-year { display: block; font-size: 13px; color: var(--muted); letter-spacing: 0.03em; }
.card-title { display: block; font-size: 21px; font-weight: 600; line-height: 1.3; margin: 2px 0 4px; }
.card:hover .card-title { text-decoration: underline; text-underline-offset: 4px; }
.card-text { display: block; font-size: 15px; line-height: 1.55; color: var(--muted); }

/* ---------------- CV */
.cv-grid { display: grid; gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (min-width: 900px) {
  .cv-grid { grid-template-columns: 4fr 8fr; }
  .cv-side { position: sticky; top: 100px; }
}
.cv-side figure { margin: 0 0 20px; max-width: 320px; }
.cv-name { margin: 0 0 8px; font-size: clamp(24px, 2.6vw, 30px); }
.cv-dob { color: var(--muted); font-size: 15px; }
.cv-side .linkedin { font-size: 15px; word-break: break-all; }
.cv-main { max-width: var(--read); }
.cv-main h1 { font-size: clamp(26px, 3vw, 34px); margin: 0 0 0.6em; }
.cv-main h1 ~ h1 { margin-top: 1.6em; }
.job { border-top: 1px solid var(--line); padding: 18px 0 6px; }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 16px; margin-bottom: 6px; }
.job-head h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.job-years { font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.job p { font-size: 16px; }

/* ---------------- footer */
.site-footer { border-top: 1px solid var(--line); margin-top: clamp(64px, 8vw, 104px); }
.footer-inner {
  padding-top: 28px; padding-bottom: 36px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px;
  font-size: 14px; color: var(--muted);
}
.footer-inner p { margin: 0; }
.footer-inner ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; }
.footer-inner li { margin: 0; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--text); text-decoration: underline; }

/* ---------------- lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(255,255,255,0.97);
  display: flex; align-items: center; justify-content: center; padding: 56px 16px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox button {
  position: absolute; background: none; border: 0; font: inherit; font-size: 32px; line-height: 1; color: var(--text);
  cursor: pointer; padding: 12px 16px;
}
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
.lb-cap { position: absolute; bottom: 12px; left: 16px; right: 16px; text-align: center; font-size: 14px; color: var(--muted); }
