/* ---------------------------------------------------------------
   Daniel Green — portfolio
   Tokens, layout, components. No build step, no dependencies.
   --------------------------------------------------------------- */

:root {
  --ink:        #0d0e10;
  --ink-2:      #15171a;
  --ink-3:      #1d2024;
  --line:       #2a2e33;
  --text:       #eae7e1;
  --text-dim:   #9ea49f;
  --text-faint: #6d736f;
  --accent:     #4fb3d1;
  --accent-dim: #2b7d96;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1180px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --radius: 3px;
  --t: 200ms cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

/* height:auto keeps the intrinsic ratio when width/height attributes are present
   and the box is narrower than declared. Overridden where a box does the fitting. */
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 1rem;
}

.lede { font-size: 1.12rem; color: var(--text-dim); max-width: 60ch; }

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--ink); padding: .75rem 1.25rem; font-weight: 600;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(13, 14, 16, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 68px;
}
.brand {
  font-family: var(--serif); font-size: 1.15rem; text-decoration: none;
  letter-spacing: .01em; white-space: nowrap;
}
.brand span { color: var(--text-faint); }

.nav { display: flex; gap: clamp(1rem, 3vw, 2.25rem); align-items: center; }
.nav a {
  text-decoration: none; font-size: .9rem; color: var(--text-dim);
  padding: .35rem 0; position: relative; transition: color var(--t);
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform var(--t);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius); padding: .5rem .7rem; cursor: pointer; font: inherit; font-size: .8rem;
}

@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--ink-2); border-bottom: 1px solid var(--line);
    padding: .5rem var(--pad) 1rem;
  }
  .nav[hidden] { display: none; }
  .nav a { padding: .7rem 0; width: 100%; font-size: 1rem; }
}

/* ---------- hero ---------- */
.hero { padding: clamp(4rem, 12vh, 8rem) 0 clamp(3rem, 8vh, 5rem); }
.hero-grid {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  align-items: center;
}
@media (max-width: 800px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  margin-bottom: 1.25rem;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.25rem); }

.portrait {
  border-radius: var(--radius);
  opacity: 1;
  border: 1px solid var(--line);
  transition: opacity var(--t);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .9rem; text-decoration: none;
  padding: .7rem 1.35rem; border-radius: var(--radius);
  border: 1px solid var(--line); color: var(--text);
  transition: border-color var(--t), background var(--t), color var(--t);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #08151a; font-weight: 600; }
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 9vh, 6rem) 0; border-top: 1px solid var(--line); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2.5rem;
}
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.section-head .more { font-size: .88rem; color: var(--text-dim); text-decoration: none; border-bottom: 1px solid var(--line); }
.section-head .more:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.5rem; }
.filters button {
  font: inherit; font-size: .85rem; cursor: pointer;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: .4rem 1rem;
  transition: all var(--t);
}
.filters button:hover { color: var(--text); border-color: var(--text-faint); }
.filters button[aria-pressed="true"] { background: var(--text); color: var(--ink); border-color: var(--text); }

/* ---------- grid ---------- */
.grid {
  display: grid; gap: clamp(1rem, 2.5vw, 1.75rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
}

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-align: left; cursor: pointer;
  font: inherit; color: inherit; padding: 0;
  transition: border-color var(--t), transform var(--t);
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-3px); }

.card-media {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: #0a0b0c; padding: 10px;
}
/* Whole work, never cropped — art is letterboxed inside the tile, not filled. */
.card-media img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform 500ms cubic-bezier(.4,0,.2,1);
}
.card:hover .card-media img { transform: scale(1.03); }

.card-media.is-blank {
  display: grid; place-items: center; padding: 1.5rem; text-align: center;
  background: linear-gradient(150deg, #1b2226 0%, #12171a 55%, #0f1214 100%);
}
.card-media.is-blank span {
  font-family: var(--serif); font-size: clamp(1.3rem, 3vw, 1.7rem); line-height: 1.2; color: var(--text-dim);
}

.card-body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card-body h3 { font-size: 1.15rem; }
.card-meta { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.card-tag {
  align-self: flex-start; margin-top: .6rem;
  font-family: var(--mono); font-size: .65rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-dim); border-radius: 999px; padding: .15rem .6rem;
}

.empty { color: var(--text-faint); font-style: italic; }

/* ---------- CV ---------- */
.cv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.cv-item { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: clamp(1rem, 4vw, 2.5rem); padding: 2rem 0; border-top: 1px solid var(--line); }
.cv-item:first-child { border-top: none; }
@media (max-width: 700px) { .cv-item { grid-template-columns: 1fr; gap: .5rem; } }
.cv-when { font-family: var(--mono); font-size: .78rem; letter-spacing: .1em; color: var(--text-faint); padding-top: .35rem; }
.cv-item h3 { font-size: 1.3rem; margin-bottom: .25rem; }
.cv-where { color: var(--accent); font-size: .9rem; margin: 0 0 .75rem; }
.cv-item p { margin: 0 0 .75rem; color: var(--text-dim); }
.cv-item ul { margin: 0; padding-left: 1.1rem; color: var(--text-dim); }
.cv-item li { margin-bottom: .35rem; }

.skills { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.skills span {
  font-family: var(--mono); font-size: .75rem; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem;
}

/* ---------- contact ---------- */
.contact-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.contact-list li:first-child { border-top: none; }
.contact-list .k { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); display: block; margin-bottom: .3rem; }
.contact-list a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); transition: all var(--t); }
.contact-list a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--line); padding: 2.5rem 0 3rem;
  color: var(--text-faint); font-size: .85rem;
}
.site-foot .wrap { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.site-foot a { color: var(--text-dim); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }

/* ---------- lightbox ---------- */
.lb[hidden] { display: none; }
.lb {
  position: fixed; inset: 0; z-index: 90;
  background: #08090a;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: clamp(1rem, 3vw, 2rem);
  animation: fade 180ms ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.lb-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; max-width: 1400px; width: 100%; margin-inline: auto; }
.lb-top h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
.lb-top .card-meta { margin-top: .4rem; }

.lb-close {
  background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: 50%; width: 42px; height: 42px; flex: none; cursor: pointer;
  font-size: 1.2rem; line-height: 1; transition: all var(--t);
}
.lb-close:hover { border-color: var(--accent); color: var(--accent); }

.lb-stage {
  position: relative; display: grid; place-items: center;
  min-height: 0; min-width: 0; overflow: hidden;
  padding: clamp(1rem, 3vw, 2rem) 0;
}
/* The image is pinned to the stage box and letterboxed inside it, so it can
   never grow the row it lives in. object-fit does the fitting, not the layout. */
.lb-stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; object-position: center;
  border-radius: var(--radius);
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(20, 22, 25, .8); border: 1px solid var(--line); color: var(--text);
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer; font-size: 1.2rem;
  transition: all var(--t);
}
.lb-nav:hover { border-color: var(--accent); color: var(--accent); }
.lb-prev { left: 0; }
.lb-next { right: 0; }

.lb-foot {
  max-width: 900px; width: 100%; margin-inline: auto; text-align: center;
  max-height: 38vh; overflow-y: auto;
}
.lb-foot p { color: var(--text-dim); margin: 0 auto .9rem; max-width: 68ch; font-size: .95rem; }
.lb-count { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; color: var(--text-faint); }
.lb-facts { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; padding: 0; margin: 0 0 1rem; }
.lb-facts li { font-size: .85rem; color: var(--text-dim); }
.lb-facts .k { font-family: var(--mono); font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); display: block; }

body.lb-open { overflow: hidden; }
