/* ---------------------------------------------------------------
   Dan — Portfolio
   Light theme only (color-scheme pinned so browser dark mode
   never inverts the page).
---------------------------------------------------------------- */

:root {
  color-scheme: light;
  --bg: #fdfdfd;
  --surface: #ffffff;
  --surface-2: #f5f5f4;
  --text: #1a1a1a;
  --text-soft: #444444;
  --muted: #8a8a8a;
  --border: #e6e6e4;
  --accent: #6366f1;
  --callout: #f0b429;
  --dot: rgba(0, 0, 0, 0.22);
  --gridline: rgba(0, 0, 0, 0.07);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

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

/* ------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.mono,
.site-header a,
.label,
.side-nav a,
.footer-links a,
.hero-cta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-header a { text-decoration: none; color: var(--text-soft); }
.site-header a:hover { color: var(--text); }

.header-nav { display: flex; align-items: center; gap: 40px; }

.brand { font-weight: 500; }

/* ------------------------------------------------- hero */

.hero {
  position: relative;
  height: calc(100vh - 77px);
  min-height: 540px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: clamp(24px, 23vw, 460px);
  padding-right: 24px;
  pointer-events: none;
}

.hero h1 {
  margin: 0 0 28px;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 600;
  line-height: 1.4;
  max-width: 520px;
  letter-spacing: -0.01em;
}

.hero-cta {
  pointer-events: auto;
  align-self: flex-start;
  text-decoration: none;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  position: relative;
}
.hero-cta::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 14px;
  height: 2px;
  background: var(--text);
  transition: width 0.3s ease;
}
.hero-cta:hover::after { width: 100%; }
.hero-cta svg { width: 14px; height: 16px; }
.hero-cta:hover svg { animation: nudge 0.8s ease infinite; }
@keyframes nudge {
  50% { transform: translateY(3px); }
}

/* ------------------------------------------------- shared layout */

.container {
  width: 70%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
}

.label {
  color: var(--muted);
  margin-bottom: 36px;
}

section.block { padding: 90px 0; }
section.block + section.block { border-top: 1px solid var(--border); }

/* ------------------------------------------------- case study cards */

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.card { text-decoration: none; display: block; }

.card-img {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.card-img img {
  width: 100%;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s ease;
}
.card:hover .card-img img { transform: scale(1.02); }

.card h3 {
  margin: 24px 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card p { margin: 0 0 14px; color: var(--text-soft); font-size: 14px; }

.card .dash {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text);
  transition: width 0.3s ease;
}
.card:hover .dash { width: 44px; }

/* ------------------------------------------------- about */

.about-grid {
  display: grid;
  grid-template-columns: 27% 1fr;
  gap: 64px;
  align-items: start;
}

.about-grid img {
  border-radius: 6px;
  width: 100%;
}

.about-text { max-width: 560px; }
.about-text p { margin: 0 0 20px; color: var(--text-soft); }

/* ------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 40px 72px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer-links a {
  text-decoration: none;
  color: var(--text-soft);
  align-self: flex-start;
  position: relative;
  padding-bottom: 4px;
}
.footer-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 12px; height: 2px;
  background: var(--text);
  transition: width 0.3s ease;
}
.footer-links a:hover::after { width: 100%; }

/* ------------------------------------------------- case study pages */

.case-layout {
  display: grid;
  grid-template-columns: 272px 1fr;
}

.case-side { position: relative; }

.side-nav {
  position: sticky;
  top: max(58vh, calc(100vh - 320px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 20px 60px 24px;
}
.side-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.side-nav a:hover,
.side-nav a.active { color: var(--text); }

.case-main {
  border-left: 1px solid var(--border);
  min-width: 0;
}

.case-header {
  padding: 72px 64px 56px;
  max-width: 980px;
}

.case-header h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.case-sub {
  margin: 0 0 36px;
  color: var(--text-soft);
  font-size: 15px;
  max-width: 560px;
}

.case-meta {
  display: flex;
  gap: 72px;
  flex-wrap: wrap;
}
.case-meta .label { margin-bottom: 6px; }
.case-meta div p { margin: 0; font-size: 14px; color: var(--text-soft); }

.case-hero {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.case-hero img { width: 100%; }

.case-section {
  padding: 72px 64px;
}
/* keep the readable column constrained, but let the section (and its
   divider) span the full width of the main column */
.case-section > .label,
.case-section > p,
.case-section > h3,
.case-section > ul,
.case-section > ol,
.case-header { max-width: 1040px; }
.case-section + .case-section { border-top: 1px solid var(--border); }

.case-section .label { margin-bottom: 28px; }
.case-section .label .num { display: block; }

.case-section p { color: var(--text-soft); max-width: 620px; }
.case-section h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 36px 0 12px;
  letter-spacing: -0.01em;
}
.case-section ul, .case-section ol { color: var(--text-soft); padding-left: 22px; }
.case-section li { margin-bottom: 8px; }

.case-img {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  margin: 8px 0;
}
.case-img img { width: 100%; height: auto; margin: 0 auto; }

/* two-column rows: media + copy */
.row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  align-items: start;
  margin-top: 12px;
}
.row.copy-first { grid-template-columns: 1fr 1.2fr; }
.row p:first-child { margin-top: 0; }

/* iteration 3: two equal-height halves when side-by-side */
@media (min-width: 961px) {
  #iteration-3 .row { grid-template-columns: 1fr 1fr; align-items: stretch; }
  #iteration-3 .row > div { display: flex; flex-direction: column; }
  #iteration-3 .row .case-img { flex: 1; margin-bottom: 0; }
  #iteration-3 .row .case-img img { height: 100%; object-fit: cover; }
}

.callout {
  border-left: 3px solid var(--callout);
  padding: 4px 0 4px 18px;
  margin: 28px 0;
  max-width: 560px;
}
.callout p { margin: 0; color: var(--text); }

.note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}
.note img {
  width: 40px; height: 48px;
  object-fit: contain;
  filter: var(--img-adapt, none);
}
.note p { margin: 0; font-size: 14px; }

/* duni stat cards + problem boxes */
.research-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  margin-top: 28px;
  align-items: start;
}
.stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}
.stat-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  padding: 24px 22px;
  height: 100%;
}
.stat-card .big {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--text);
}
.stat-card p { font-size: 13px; margin: 0; }
.stat-card a { color: var(--text-soft); }

.online-block h4, .interviews h4 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}

.box {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 28px 32px;
  margin-top: 40px;
  max-width: 820px;
}
.box h4 {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 12px;
  font-weight: 500;
}
.box p { margin: 0; max-width: none; }

.quote-attr {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 16px;
}

/* ------------------------------------------------- modal */

.link-btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0 0 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-top: 16px;
  display: inline-block;
  position: relative;
}
.link-btn::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 14px; height: 2px;
  background: var(--text);
  transition: width 0.3s ease;
}
.link-btn:hover { color: var(--text); }
.link-btn:hover::after { width: 100%; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(10, 10, 12, 0.65);
  backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }

.modal {
  position: relative;
  background: #fff;
  border-radius: 8px;
  max-width: min(960px, 100%);
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}
.modal img { display: block; width: 100%; height: auto; }

.modal-close {
  position: sticky;
  top: 12px;
  margin-left: auto;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  color: #444;
  cursor: pointer;
  z-index: 1;
}
.modal-close:hover { color: #000; border-color: #aaa; }
.modal-close svg { width: 14px; height: 14px; }

/* ------------------------------------------------- carousel */

.carousel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  transition: transform 0.45s ease;
}
.carousel-track img {
  width: 100%;
  flex-shrink: 0;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.carousel-btn:hover { color: var(--text); border-color: var(--muted); }
.carousel-btn svg { width: 16px; height: 16px; }
.carousel-btn.prev { left: 14px; }
.carousel-btn.next { right: 14px; }

.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(120, 120, 120, 0.25);
}
.carousel-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.2s ease;
}
.carousel-dots button.active { background: #fff; }
.carousel-dots button:not(.active):hover { background: rgba(255, 255, 255, 0.9); }

/* ------------------------------------------------- selected screens board */

.screens-board {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 32px;
  margin-top: 8px;
}
.screens-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px 44px;
  align-items: center;
}
.screens-grid img { width: 100%; height: auto; }

/* ------------------------------------------------- resume */

.resume { padding: 56px 0 88px; }

.resume-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 30px;
  margin-bottom: 40px;
  position: relative;
}
.resume-head h1 {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.resume-tagline {
  color: var(--text-soft);
  font-size: 16px;
  margin: 0 0 20px;
  max-width: 640px;
}
.resume-contact {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.resume-contact a { color: var(--muted); text-decoration: none; }
.resume-contact a:hover { color: var(--text); }

.print-btn {
  position: absolute;
  top: 4px;
  right: 0;
  appearance: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 14px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.print-btn:hover { color: var(--text); border-color: var(--muted); }

.resume-grid {
  display: grid;
  grid-template-columns: 1fr 2.3fr;
  gap: 56px;
  align-items: start;
}

.resume-block + .resume-block { margin-top: 36px; }
.resume-block > .label { margin-bottom: 18px; }

.skill-group { margin-bottom: 18px; }
.skill-group h4 { font-size: 13px; font-weight: 600; margin: 0 0 5px; }
.skill-group p { margin: 0; color: var(--text-soft); font-size: 13px; line-height: 1.6; }

.edu-item { margin-bottom: 20px; }
.edu-item h4 { font-size: 14px; font-weight: 600; margin: 0 0 2px; }
.edu-item .org { color: var(--text-soft); font-size: 13px; }
.edu-item .yr {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.resume-summary { color: var(--text-soft); margin: 0 0 28px; max-width: 640px; }

.job { padding: 22px 0; border-top: 1px solid var(--border); }
.job:first-of-type { border-top: none; padding-top: 0; }
.job-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.job-head h3 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.job-dates {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}
.job-org { color: var(--text-soft); font-size: 14px; margin: 0 0 12px; }
.job ul { margin: 0; padding-left: 18px; color: var(--text-soft); }
.job li { margin-bottom: 6px; font-size: 14px; line-height: 1.55; }

/* print / save-as-PDF: force a clean light layout on one page */
@media print {
  :root {
    --bg: #ffffff; --surface: #ffffff; --surface-2: #f5f5f4;
    --text: #111111; --text-soft: #333333; --muted: #666666;
    --border: #cccccc; --accent: #111111;
  }
  .site-header, .site-footer, .print-btn { display: none !important; }
  .resume { padding: 0; }
  .container { width: 100%; max-width: none; padding: 0; }
  body { font-size: 12px; }
  .job, .edu-item, .resume-block { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 1.4cm; }
}

/* ------------------------------------------------- responsive */

@media (max-width: 960px) {
  .case-layout { grid-template-columns: 1fr; }
  .case-side { display: none; }
  .case-main { border-left: none; }
  .case-header, .case-section { padding-left: 28px; padding-right: 28px; }
  .row, .row.copy-first { grid-template-columns: 1fr; gap: 28px; }
  .research-grid { grid-template-columns: 1fr; }
  .screens-board { padding: 18px; }
  .screens-grid { gap: 18px 20px; }
  .resume-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 760px) {
  .container { width: auto; max-width: none; padding: 0 24px; }
  .cards { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-grid img { width: 50%; max-width: none; }
  .site-header { padding: 18px 24px; }
  .header-nav { gap: 24px; }
  .hero-inner { padding-left: 24px; }
  section.block { padding: 64px 0; }
  .print-btn { position: static; margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
