/* ==========================================================================
   Jamie Dinnebier — Portfolio
   Plain CSS. Dark, minimal, engineering-led.
   ========================================================================== */

:root {
  --bg: #0b0b0c;
  --bg-raised: #131315;
  --line: #26262a;
  --text: #f2f2ef;
  --muted: #9b9b9f;
  --faint: #5f5f64;

  /* Default accent (home page). Project pages override these. */
  --accent: #f2f2ef;
  --accent-2: var(--accent);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max: 1240px;
  --gutter: clamp(20px, 5vw, 56px);
  --section: clamp(88px, 12vw, 168px);
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Project accents */
.theme-ceramic   { --accent: #5fcf7e; --accent-2: #2f8f4e; }
.theme-briefchair{ --accent: #5b8cff; --accent-2: #1d3a8a; }
.theme-luma      { --accent: #ff4b3e; --accent-2: #ffc22e; }

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent); color: var(--bg); }

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

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  padding: 10px 14px;
  background: var(--text); color: var(--bg);
  z-index: 100; text-decoration: none; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

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

/* Small mono labels give the "drawing annotation" feel */
.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 11, 12, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-nav.is-scrolled { border-bottom-color: var(--line); }
.site-nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.nav-logo { display: flex; align-items: center; flex-shrink: 0; }
.nav-logo img { width: 52px; height: auto; }
.nav-links { display: flex; gap: clamp(14px, 3vw, 36px); }
.nav-links a {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; color: var(--muted);
  padding: 6px 0;
  position: relative;
  transition: color .2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

@media (max-width: 420px) {
  .nav-logo img { width: 40px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 11px; letter-spacing: 0.04em; }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding: var(--section) 0 0; }
.section:last-of-type { padding-bottom: var(--section); }

.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: clamp(40px, 6vw, 72px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.section-head h2 { font-size: clamp(32px, 5vw, 56px); }
@media (min-width: 860px) {
  .section-head { grid-template-columns: 220px 1fr; align-items: baseline; }
}

/* --------------------------------------------------------------------------
   Hero (home)
   -------------------------------------------------------------------------- */
.hero {
  min-height: calc(100svh - 64px);
  display: flex; align-items: center;
  padding: clamp(48px, 8vw, 96px) 0;
}
.hero-logo { width: clamp(180px, 26vw, 320px); margin-bottom: clamp(16px, 2vw, 24px); }
.hero h1 {
  font-size: clamp(48px, 9vw, 120px);
  letter-spacing: -0.045em;
  line-height: 0.95;
}
.hero-role {
  margin-top: 20px;
  font-size: clamp(17px, 2vw, 22px);
  color: var(--muted);
}
.hero-role .sep { color: var(--faint); padding: 0 .4em; }
.hero-intro {
  display: grid; gap: 0 48px;
  margin-top: clamp(40px, 6vw, 72px);
  max-width: 1040px;
  color: #cfcfcc;
}
@media (min-width: 860px) { .hero-intro { grid-template-columns: 1fr 1fr; } }
.hero-meta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 28px; }

/* --------------------------------------------------------------------------
   Experience
   -------------------------------------------------------------------------- */
.exp-feature {
  display: grid; gap: 28px;
  padding: clamp(28px, 4vw, 48px);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
@media (min-width: 860px) { .exp-feature { grid-template-columns: 1fr 1.4fr; gap: 56px; } }
.exp-feature h3 { font-size: clamp(26px, 3.4vw, 40px); }
.exp-company { margin-top: 10px; font-size: 18px; }
.exp-dates { margin-top: 14px; }

.bullets li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: #d3d3d0;
}
.bullets li::before {
  content: ""; position: absolute; left: 0; top: 0.8em;
  width: 10px; height: 1px; background: var(--muted);
}

.exp-grid { display: grid; gap: 24px; }
@media (min-width: 700px) { .exp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .exp-grid { grid-template-columns: repeat(3, 1fr); } }
.exp-item {
  padding: 24px 0 8px;
  border-top: 1px solid var(--line);
}
.exp-item h3 { font-size: 20px; letter-spacing: -0.01em; }
.exp-item .exp-company { font-size: 16px; color: var(--text); margin-top: 6px; }
.exp-item .exp-dates { margin: 6px 0 16px; }
.exp-item .bullets li { font-size: 15px; }

/* --------------------------------------------------------------------------
   Project cards (home)
   -------------------------------------------------------------------------- */
.project-grid { display: grid; gap: 56px clamp(20px, 3vw, 32px); }
@media (min-width: 600px) and (max-width: 999px) {
  .project-grid { grid-template-columns: 1fr 1fr; }
  .project-grid .project-card:first-child { grid-column: 1 / -1; }
  .project-grid .project-card:first-child .card-media { aspect-ratio: 16 / 10; }
}
@media (min-width: 1000px) { .project-grid { grid-template-columns: repeat(3, 1fr); } }

.project-card {
  display: block; text-decoration: none;
  --accent-card: var(--text);
}
.project-card.theme-ceramic, .project-card.theme-briefchair, .project-card.theme-luma { --accent-card: var(--accent); }
.project-card .card-media {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--bg-raised);
  border-radius: var(--radius);
}
.project-card .card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease), filter .8s var(--ease);
}
.project-card .card-media::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left;
  transition: transform .6s var(--ease);
}
.project-card:hover .card-media img,
.project-card:focus-visible .card-media img { transform: scale(1.04); }
.project-card:hover .card-media::after,
.project-card:focus-visible .card-media::after { transform: scaleX(1); }

.card-body { padding-top: 18px; display: flex; justify-content: space-between; gap: 16px; }
.card-body h3 { font-size: 24px; }
.card-body p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.card-num { color: var(--accent); }
.card-arrow {
  font-size: 20px; color: var(--muted);
  transition: transform .4s var(--ease), color .3s;
}
.project-card:hover .card-arrow { transform: translateX(6px); color: var(--accent); }

/* --------------------------------------------------------------------------
   Skills
   -------------------------------------------------------------------------- */
.skills-grid { display: grid; gap: 40px 32px; }
@media (min-width: 640px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .skills-grid { grid-template-columns: repeat(4, 1fr); } }
.skill-group h3 {
  font-size: 15px; font-weight: 500;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.skill-group li { padding: 5px 0; color: #d3d3d0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 14px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: #d3d3d0;
}

/* --------------------------------------------------------------------------
   Qualifications
   -------------------------------------------------------------------------- */
.quals li {
  display: grid; gap: 4px 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.quals li:first-child { border-top: 1px solid var(--line); }
@media (min-width: 700px) { .quals li { grid-template-columns: 1fr auto; align-items: baseline; } }
.quals strong { font-weight: 500; font-size: 18px; }
.quals .sub { display: block; color: var(--muted); font-size: 15px; margin-top: 2px; }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact-lead { font-size: clamp(28px, 4.4vw, 52px); letter-spacing: -0.03em; line-height: 1.1; max-width: 18ch; margin-bottom: 48px; }
.contact-list li { border-bottom: 1px solid var(--line); }
.contact-list li:first-child { border-top: 1px solid var(--line); }
.contact-list a {
  display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 16px;
  padding: 22px 0;
  text-decoration: none;
  font-size: clamp(17px, 2.2vw, 24px);
  transition: color .2s, padding-left .4s var(--ease);
  word-break: break-word;
}
.contact-list a:hover { padding-left: 10px; }
.contact-list .arrow { color: var(--muted); transition: transform .4s var(--ease); }
.contact-list a:hover .arrow { transform: translate(4px, -4px); color: var(--text); }
@media (max-width: 560px) {
  .contact-list a { grid-template-columns: 1fr auto; }
  .contact-list .label { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
}
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer img { width: 40px; opacity: .7; }

/* --------------------------------------------------------------------------
   Project (case study) pages
   -------------------------------------------------------------------------- */
.cs-hero { padding-top: clamp(40px, 6vw, 72px); }
.cs-title-row {
  display: grid; gap: 20px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
@media (min-width: 860px) { .cs-title-row { grid-template-columns: 1fr auto; align-items: end; } }
.cs-hero .label .accent { color: var(--accent); }
.cs-hero h1 {
  font-size: clamp(52px, 10vw, 136px);
  letter-spacing: -0.05em; line-height: .92;
  margin-top: 16px;
}
.cs-tagline {
  font-size: clamp(18px, 2.2vw, 24px);
  color: var(--muted);
  max-width: 28ch;
  margin: 0;
}
@media (min-width: 860px) { .cs-tagline { text-align: right; } }
.cs-tagline em { font-style: normal; color: var(--accent); }

.cs-hero-image {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
}
.cs-hero-image img { width: 100%; max-height: 88vh; object-fit: cover; }
.accent-bar {
  height: 3px; margin-top: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.cs-overview {
  display: grid; gap: 40px;
  padding-top: clamp(56px, 8vw, 112px);
}
@media (min-width: 860px) { .cs-overview { grid-template-columns: 220px 1fr 1fr; gap: 56px; } }
.cs-overview h2 { font-size: 15px; font-weight: 500; margin-bottom: 14px; color: var(--accent); letter-spacing: 0; }
.cs-overview p { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.55; color: #deded9; }

.step {
  padding-top: clamp(72px, 10vw, 136px);
}
.step-head {
  display: grid; gap: 16px;
  margin-bottom: clamp(28px, 4vw, 48px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
@media (min-width: 860px) { .step-head { grid-template-columns: 220px 1fr; gap: 56px; } }
.step-num { color: var(--accent); }
.step-head h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 18px; }
.step-head p, .step-head li { color: #d3d3d0; max-width: 64ch; }

/* Image layouts — images keep their natural proportions (no cropping of drawings) */
.figure { margin: 0; }
.figure + .figure { margin-top: clamp(16px, 2.4vw, 28px); }
.figure img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.figure figcaption, .gallery figcaption {
  margin-top: 10px;
  font-size: 13px; color: var(--muted);
}
.gallery {
  columns: 2;
  column-gap: clamp(16px, 2.4vw, 28px);
  margin-top: clamp(16px, 2.4vw, 28px);
}
.gallery.cols-3 { columns: 3; }
.gallery figure {
  margin: 0 0 clamp(16px, 2.4vw, 28px);
  break-inside: avoid;
}
.gallery img { width: 100%; border-radius: var(--radius); background: var(--bg-raised); }
@media (max-width: 640px) {
  .gallery.cols-3 { columns: 2; }
}
@media (max-width: 420px) {
  .gallery, .gallery.cols-3 { columns: 1; }
}

/* Clickable images */
.zoomable { cursor: zoom-in; transition: opacity .3s; }
.zoomable:hover { opacity: .9; }

.cs-skills { padding-top: clamp(72px, 10vw, 136px); }
.cs-skills .chips li { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* Prev / next */
.cs-pager {
  display: grid; gap: 0;
  margin-top: clamp(72px, 10vw, 136px);
  border-top: 1px solid var(--line);
}
@media (min-width: 760px) { .cs-pager { grid-template-columns: 1fr auto 1fr; } }
.cs-pager a {
  display: block; text-decoration: none;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  transition: color .2s;
}
@media (min-width: 760px) {
  .cs-pager a { border-bottom: 0; }
  .cs-pager .home { padding: 28px clamp(24px, 4vw, 56px); border-left: 1px solid var(--line); border-right: 1px solid var(--line); align-self: stretch; display: flex; align-items: center; }
  .cs-pager .next { text-align: right; }
}
.cs-pager .title { display: block; margin-top: 6px; font-size: clamp(22px, 3vw, 34px); font-weight: 600; letter-spacing: -0.02em; transition: color .2s, transform .4s var(--ease); }
.cs-pager a:hover .title { color: var(--accent); }
.cs-pager .prev:hover .title { transform: translateX(-6px); }
.cs-pager .next:hover .title { transform: translateX(6px); }

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(5, 5, 6, 0.96);
  color: var(--text);
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure {
  margin: 0; padding: 64px 72px 72px;
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.lightbox img {
  max-width: 100%; max-height: calc(100% - 32px);
  width: auto; height: auto; object-fit: contain;
}
.lightbox figcaption { margin-top: 14px; font-size: 14px; color: var(--muted); text-align: center; max-width: 70ch; }
.lb-btn {
  position: absolute;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--text); font-size: 20px; line-height: 1;
  cursor: pointer;
  transition: background .2s;
}
.lb-btn:hover { background: rgba(255,255,255,0.14); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; top: 26px; left: 20px; }
@media (max-width: 640px) {
  .lightbox figure { padding: 64px 12px 88px; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
}
body.lb-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   Scroll reveal (only when JS is running; content is visible without JS)
   -------------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .project-card:hover .card-media img { transform: none; }
}
