:root {
  --bg: #f3f0e9;
  --surface: #fffdf8;
  --ink: #242321;
  --ink-2: #6d6a63;
  --ink-3: #928e85;
  --line: rgba(64, 59, 50, 0.14);
  --accent: #eb705e;
  --accent-soft: #ffdcd4;
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: var(--font-sans); }
body {
  position: relative;
  margin: 0;
  min-width: 320px;
  background-image: radial-gradient(circle at 1px 1px, rgba(55, 50, 42, 0.08) 1px, transparent 0);
  background-size: 24px 24px;
}
button, a { font: inherit; }
button { color: inherit; }
::selection { background: var(--accent-soft); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.portfolio-shell {
  width: min(calc(100% - 64px), 1040px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 64px 0 40px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}
.profile {
  grid-column: 1 / span 4;
  position: sticky;
  top: 64px;
  min-height: calc(100svh - 104px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.profile-copy {
  display: grid;
  gap: 20px;
}
.eyebrow, .name, .bio, .availability, .copyright { margin: 0; }
.eyebrow { margin-bottom: -17px; color: var(--ink-2); font-size: 0.875rem; line-height: 1.4; }
.name { font: 400 3.75rem/0.95 var(--font-display); letter-spacing: -0.035em; }
.name span { color: var(--accent); }
.bio { max-width: 30ch; color: var(--ink-2); font-size: 1rem; line-height: 1.65; }
.availability { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font: 0.75rem/1.4 var(--font-mono); }
.availability span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.contact-links { display: flex; flex-wrap: wrap; gap: 24px; }
a { color: var(--ink); font-size: 0.9375rem; line-height: 1.5; text-decoration-color: rgba(64, 59, 50, 0.28); text-underline-offset: 3px; transition: color 150ms, text-decoration-color 150ms; }
a span { color: var(--ink-3); }
a:hover, a:focus-visible { color: var(--accent); text-decoration-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.copyright { color: var(--ink-3); font: 0.75rem/1.4 var(--font-mono); }

.projects { grid-column: 6 / span 7; }
.projects-heading { margin: 0 4px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.projects-heading p { margin: 0; font-size: 0.875rem; font-weight: 500; }
.projects-heading span { color: var(--ink-3); font: 0.75rem/1.4 var(--font-mono); }
.folder-desk { position: relative; min-height: 650px; }
.global-folder-layer {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  min-height: 100%;
  pointer-events: none;
  z-index: 2;
}
.global-folder-layer .folder { pointer-events: auto; }
.folder {
  --folder: #b9ddff;
  --folder-deep: #8fc2ef;
  position: absolute;
  width: min(64%, 310px);
  filter: drop-shadow(0 16px 16px rgba(60, 54, 44, 0.13));
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 240ms var(--ease), filter 240ms var(--ease);
}
.folder:nth-of-type(1) { --folder: #b9ddff; --folder-deep: #8fc2ef; top: 32px; left: 4%; transform: rotate(-5deg); z-index: 2; }
.folder:nth-of-type(2) { --folder: #ffd49c; --folder-deep: #f0b96f; top: 118px; right: 0; transform: rotate(5deg); z-index: 4; }
.folder:nth-of-type(3) { --folder: #bfe8d0; --folder-deep: #91cea9; top: 242px; left: 1%; transform: rotate(3deg); z-index: 3; }
.folder:nth-of-type(4) { --folder: #e0cdf8; --folder-deep: #c0a4e7; top: 355px; right: 3%; transform: rotate(-4deg); z-index: 5; }
.folder:nth-of-type(5) { --folder: #ffc7cf; --folder-deep: #eba1ae; top: 458px; left: 8%; transform: rotate(5deg); z-index: 6; }
.folder:hover, .folder:focus-within { filter: drop-shadow(0 24px 20px rgba(60, 54, 44, 0.2)); }
.folder:nth-of-type(1):hover, .folder:nth-of-type(1):focus-within { transform: rotate(-2deg) translateY(-9px) scale(1.025); }
.folder:nth-of-type(2):hover, .folder:nth-of-type(2):focus-within { transform: rotate(2deg) translateY(-9px) scale(1.025); }
.folder:nth-of-type(3):hover, .folder:nth-of-type(3):focus-within { transform: rotate(1deg) translateY(-9px) scale(1.025); }
.folder:nth-of-type(4):hover, .folder:nth-of-type(4):focus-within { transform: rotate(-1deg) translateY(-9px) scale(1.025); }
.folder:nth-of-type(5):hover, .folder:nth-of-type(5):focus-within { transform: rotate(2deg) translateY(-9px) scale(1.025); }
.folder.is-dragging {
  z-index: 100 !important;
  filter: drop-shadow(0 30px 24px rgba(60, 54, 44, 0.25));
  cursor: grabbing;
  transform: rotate(0deg) scale(1.04) !important;
  transition: filter 120ms var(--ease), transform 120ms var(--ease);
}
.folder-tab {
  width: 69%;
  height: 43px;
  padding: 8px 15px 6px;
  border: 1px solid rgba(59, 55, 48, 0.1);
  border-bottom: 0;
  border-radius: 16px 19px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--folder-deep);
}
.project-name { overflow: hidden; font-size: 0.9375rem; font-weight: 500; letter-spacing: -0.01em; text-overflow: ellipsis; white-space: nowrap; }
.folder-index { color: rgba(45, 42, 38, 0.52); font: 0.6875rem/1.4 var(--font-mono); }
.folder-body {
  position: relative;
  min-height: 164px;
  margin-top: -1px;
  border: 1px solid rgba(59, 55, 48, 0.1);
  border-radius: 0 18px 18px 18px;
  overflow: hidden;
  background: var(--folder);
}
.folder-body::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: rgba(255, 255, 255, 0.4); }
.folder h2 { position: absolute; inset: 0; margin: 0; }
.folder h2 button {
  width: 100%;
  height: 100%;
  padding: 20px;
  border: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  background: transparent;
  text-align: left;
  cursor: inherit;
}
.folder h2 button:focus-visible { outline: 3px solid var(--accent); outline-offset: -6px; border-radius: 18px; }
.project-hint { color: rgba(45, 42, 38, 0.68); font: 0.8125rem/1.4 var(--font-mono); }
.project-hint::before { content: "↳ "; }
.project-year { color: rgba(45, 42, 38, 0.62); font: 0.75rem/1.4 var(--font-mono); }
.folder-reveal { display: none; }

.project-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
}
.project-dialog::backdrop { background: rgba(37, 34, 29, 0.32); backdrop-filter: blur(7px); }
.project-dialog[open] { animation: dialog-in 220ms var(--ease); }
.dialog-stage { position: relative; width: 100%; height: 100%; overflow: auto; }
.dialog-toolbar {
  position: fixed;
  z-index: 1000;
  top: 18px;
  left: 50%;
  width: min(calc(100% - 28px), 620px);
  padding: 8px 8px 8px 16px;
  border: 1px solid rgba(64, 59, 50, 0.14);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 12px 30px rgba(38, 34, 28, 0.14);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}
.dialog-kicker { margin: 0; color: var(--ink-3); font: 0.75rem/1.4 var(--font-mono); }
.dialog-actions { display: flex; align-items: center; gap: 6px; }
.dialog-spread { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 0.8125rem; cursor: pointer; }
.dialog-spread:hover { color: var(--ink); background: var(--accent-soft); }
.dialog-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #f1eee7; font-size: 1.5rem; line-height: 1; cursor: pointer; transition: transform 160ms var(--ease), background 160ms; }
.dialog-close:hover { transform: rotate(7deg); background: var(--accent-soft); }
.dialog-close:focus-visible, .dialog-spread:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dialog-content { position: relative; min-width: 100%; min-height: max(100%, 1040px); }
.project-card-canvas { position: absolute; inset: 0; min-height: inherit; }
.project-card {
  --card-rotation: 0deg;
  position: absolute;
  width: min(390px, calc(100vw - 36px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f7f4ed;
  box-shadow: 0 24px 48px -26px rgba(38, 34, 28, 0.52), 0 3px 10px rgba(38, 34, 28, 0.08);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: rotate(var(--card-rotation));
  transition: left 360ms var(--ease), top 360ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.is-spreading .project-card {
  transition: left 700ms var(--ease-soft), top 700ms var(--ease-soft), transform 700ms var(--ease-soft), box-shadow 180ms var(--ease);
  transition-delay: calc(var(--card-order, 0) * 45ms), calc(var(--card-order, 0) * 45ms), calc(var(--card-order, 0) * 45ms), 0ms;
}
.project-card.is-dragging { cursor: grabbing; transform: rotate(0deg) scale(1.025); box-shadow: 0 34px 58px -24px rgba(38, 34, 28, 0.58); transition: transform 100ms, box-shadow 100ms; }
.project-card--overview { width: min(460px, calc(100vw - 36px)); padding: 28px; background: color-mix(in srgb, var(--dialog-color) 34%, var(--surface)); }
.project-card--story { background: #fffaf0; }
.project-card--details { background: #f2f0eb; }
.project-card--shots { width: min(470px, calc(100vw - 36px)); background: #f8f6f1; }
.project-card-label-row { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.project-card-label { margin: 0; color: var(--ink-3); font: 0.75rem/1.4 var(--font-mono); letter-spacing: 0.03em; text-transform: uppercase; }
.project-card-grip { color: rgba(64, 59, 50, 0.45); font: 0.6875rem/1.4 var(--font-mono); white-space: nowrap; }
.project-card-title { margin: 0 0 12px; font-size: 1.125rem; line-height: 1.3; font-weight: 500; }
.project-card--overview .project-card-title { font: 400 2.5rem/1.05 var(--font-display); letter-spacing: -0.025em; }
.project-card-copy { max-width: 62ch; margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.7; }
.project-links { margin: 20px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.project-links a { cursor: pointer; }
.project-card-note {margin: 0 0 18px; color: var(--ink-2); font-size: 0.875rem; line-height: 1.5; }
.shot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shot-placeholder {
  aspect-ratio: 16 / 9;
  padding: 14px;
  border: 1px dashed rgba(64, 59, 50, 0.24);
  border-radius: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  color: var(--ink-3);
}
.shot { margin: 0; display: grid; gap: 8px; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); pointer-events: none; -webkit-user-drag: none; }
.shot--contain img { object-fit: contain; }
.shot figcaption { color: var(--ink-2); font-size: 0.8125rem; line-height: 1.4; }
.shot-number {font: 0.75rem/1.4 var(--font-mono); }
.shot-caption { font-size: 0.8125rem; line-height: 1.4; }
dl { margin: 0; padding-top: 8px; display: grid; gap: 12px; }
dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: baseline; }
dt { color: var(--ink-3); font: 0.75rem/1.4 var(--font-mono); letter-spacing: 0.05em; text-transform: uppercase; }
dd { margin: 0; font-size: 0.9375rem; line-height: 1.5; }
.stack { display: flex; flex-wrap: wrap; gap: 6px; }
.stack span { padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font: 0.75rem/1.4 var(--font-mono); }
@keyframes dialog-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1023px) {
  .portfolio-shell { width: min(calc(100% - 48px), 920px); }
  .profile { grid-column: 1 / span 5; }
  .projects { grid-column: 6 / span 7; }
  .folder { width: min(70%, 290px); }
}
@media (max-width: 767px) {
  .portfolio-shell { width: calc(100% - 32px); min-height: auto; padding: 36px 0 44px; display: block; }
  .profile { position: static; min-height: auto; display: block; }
  .copyright { display: none; }
  .projects { margin-top: 44px; }
  .folder-desk { min-height: 720px; }
  .folder { width: min(78%, 300px); }
  .folder:nth-of-type(1) { top: 32px; left: 1%; }
  .folder:nth-of-type(2) { top: 145px; right: 1%; }
  .folder:nth-of-type(3) { top: 276px; left: 0; }
  .folder:nth-of-type(4) { top: 402px; right: 0; }
  .folder:nth-of-type(5) { top: 530px; left: 5%; }
  .folder-body { min-height: 150px; }
  .dialog-toolbar { top: 10px; width: calc(100% - 20px); padding-left: 12px; }
  .dialog-kicker { display: none; }
  .dialog-actions { width: 100%; justify-content: space-between; }
  .dialog-content { min-height: 1160px; }
  .project-card, .project-card--overview { width: calc(100vw - 36px); padding: 20px; }
  .project-card--overview .project-card-title { font-size: 2.1rem; }
  .shot-grid { grid-template-columns: 1fr; }
  dl > div { grid-template-columns: 72px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .folder:hover, .folder:focus-within { transform: none; }
}
