/* The project gallery follows the wide, dark composition of the reference. */
:root {
  --work-bg: #000;
  --work-ink: #f7f7f7;
  --work-muted: #999;
  --work-line: #454545;
}

.work-section {
  max-width: none;
  margin: 0;
  padding: clamp(100px, 6.5vw, 130px) clamp(20px, 2.6vw, 64px);
  color: var(--work-ink);
  background: var(--work-bg);
  /* The section's own top padding already clears the fixed header. */
  scroll-margin-top: -90px;
  color-scheme: dark;
}
.work-section .section-heading { align-items: center; gap: 32px; }
.work-section .section-heading h2 {
  font-size: clamp(36px, 3.35vw, 64px);
  line-height: 1.14;
  letter-spacing: -.055em;
}
.view-all {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 3px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  text-transform: uppercase;
  font-size: 13px;
}
.view-all > span:first-child {
  border: 1px solid #777;
  border-radius: 999px;
  padding: 4px 27px;
  color: #bbb;
  line-height: 1.5;
  transition: border-color .25s, color .25s;
}
.view-all-arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--work-ink);
  color: #101820;
  font-size: 18px;
  transition: background .25s, transform .3s var(--ease);
}
.view-all:hover > span:first-child { border-color: var(--work-ink); color: var(--work-ink); }
.view-all:hover .view-all-arrow { background: var(--accent); color: white; transform: rotate(45deg); }
.work-section .work-toolbar { margin: clamp(32px, 2.5vw, 48px) 0 30px; }
.work-section .filters { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.work-section .filter {
  min-height: clamp(48px, 3.15vw, 60px);
  padding: 10px clamp(28px, 3vw, 58px);
  border: 1px solid var(--work-line);
  border-radius: 999px;
  background: transparent;
  color: #c4c4c4;
  font-size: clamp(16px, 1.25vw, 24px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.04em;
  text-transform: uppercase;
  transition: border-color .25s, color .25s, background .25s;
}
.work-section .filter:hover { color: white; border-color: #888; background: #181818; }
.work-section .filter.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px #ffffff25;
}
.work-section :is(button, a):focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.work-section .filter.active:focus-visible { outline-color: white; }
.work-section .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px 12px; }
.work-section .project-card { min-width: 0; }
.work-section .project-open { color: var(--work-ink); border-radius: 24px; }
.work-section .project-image {
  container-type: inline-size;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: clamp(20px, 1.6vw, 30px);
  color: #20221f;
}
.work-section .project-tags {
  margin-top: clamp(20px, 1.55vw, 30px);
  gap: 0;
  color: var(--work-muted);
  font-size: clamp(12px, 1.04vw, 20px);
  font-weight: 400;
  line-height: 1.5;
  text-transform: uppercase;
}
.work-section .project-tags > span { padding: 0; border: 0; border-radius: 0; }
.work-section .project-tags > span + span::before { content: "/"; margin-inline: .35em; color: #747474; }
.work-section .project-meta { align-items: flex-start; margin-top: 18px; gap: 16px; }
.work-section .project-title {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: clamp(24px, 1.8vw, 34px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.04em;
}
.project-arrow { display: inline-block; flex-shrink: 0; color: var(--accent); transition: transform .3s var(--ease); }
.project-open:hover .project-arrow, .project-open:focus-visible .project-arrow { transform: translate(3px, -3px); }
.work-section .project-summary { margin-top: 10px; color: var(--work-muted); font-size: clamp(13px, 1vw, 16px); }
.work-section .project-year { flex-shrink: 0; padding-top: 8px; color: #888; font-size: 11px; }
.work-section .concept-note { display: block; margin-top: 64px; color: var(--work-muted); font-size: 12px; }
.work-section .project-view { color: #101820; font-size: 12px; background: #f7f7f7; }

/* Actual artwork: retain portrait proportions inside the wide project stage. */
.work-section .project-open { text-decoration: none; }
.work-section .artwork-preview {
  --art-tone: #263b3b;
  display: block;
  padding: 0;
  background: radial-gradient(ellipse at 50% 30%, var(--art-tone), #101315 110%);
}
.artwork-preview.tone-green { --art-tone: #176552; }
.artwork-preview.tone-blue { --art-tone: #2b4755; }
.artwork-preview.tone-stone { --art-tone: #676353; }
.artwork-preview.tone-charcoal { --art-tone: #494949; }
.artwork-preview.tone-violet { --art-tone: #5c285e; }
.artwork-preview.tone-indigo { --art-tone: #2e2b66; }
.artwork-preview.tone-teal { --art-tone: #135a57; }
.artwork-preview > img {
  position: absolute;
  left: 5%;
  top: 5%;
  width: 90%;
  height: 90%;
  max-width: none;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px #0005);
  transition: transform .6s var(--ease);
}
.artwork-pair > img { left: 40%; width: 55%; }
.artwork-pair > img:first-child { left: 5%; width: 32%; }
.project-open:is(:hover, :focus-visible) .artwork-preview > img { transform: scale(1.025); }
.work-section .project-year { max-width: 140px; line-height: 1.5; }
.work-section .concept-note { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; line-height: 1.6; }

/* Development covers identify the applications; the links open the real work. */
.app-cover { position: relative; overflow: hidden; }
.app-cover .cover-caption { position: absolute; z-index: 2; top: 8%; left: 7%; font-size: 1.5cqw; letter-spacing: .13em; }
.velour-images { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; }
.velour-images > img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.6); }
.velour-wordmark { position: absolute; inset: 0; display: grid; place-items: center; color: white; font: 400 13cqw/1 Georgia, serif; letter-spacing: .08em; }
.velour-cover .cover-caption { top: auto; bottom: 12%; left: 0; width: 100%; text-align: center; color: #fff; font-size: 1.35cqw; }
.subnet-cover { background: #ece9f5; }
.subnet-cover > .cover-caption { color: #5e4a80; }
.subnet-cover-title { position: absolute; top: 25%; left: 7%; color: #30205d; font-size: 6.1cqw; font-weight: 650; line-height: 1.12; letter-spacing: -.05em; }
.subnet-cover-title > span { color: #8d74b6; }
.subnet-cover-window { position: absolute; top: 19%; right: -4%; width: 55%; height: 66%; border-radius: 1.5cqw; background: #fff; border: 1px solid #ded8eb; box-shadow: 0 2cqw 5cqw #30205d25; padding: 0 3cqw 2cqw; transform: rotate(-3deg); }
.subnet-window-top { display: flex; align-items: center; gap: .6cqw; height: 5cqw; border-bottom: 1px solid #eeeaf5; }
.subnet-window-top > i { width: .65cqw; height: .65cqw; border-radius: 50%; background: #cbc2de; }
.subnet-window-top > span { font-size: .85cqw; color: #82778d; margin-left: 1cqw; }
.subnet-cover-label { display: block; color: #5c526e; margin-top: 3cqw; font-size: 1.8cqw; }
.subnet-ip { display: block; margin-top: 2.2cqw; font-size: 3.4cqw; color: #30205d; font-weight: 650; letter-spacing: -.05em; }
.subnet-ip small { font-size: 1.7cqw; background: #f2eef9; padding: .6cqw; border-radius: .6cqw; }
.subnet-metrics { display: flex; gap: 3.6cqw; margin-top: 2.5cqw; }
.subnet-metrics > span { display: flex; flex-direction: column; }
.subnet-metrics small { font-size: 1.05cqw; color: #82778d; }
.subnet-metrics b { font-size: 2.6cqw; color: #30205d; margin-top: .7cqw; }
.santolan-cover { background: radial-gradient(ellipse at 80% 40%, #5a1122, transparent 65%), #111519; color: #fff; }
.santolan-cover > .cover-caption { color: #c9acb3; }
.santolan-symbol { position: absolute; width: 25%; top: 28%; right: 9%; padding: 1.4cqw; border: 1px solid #f1b0bd55; border-radius: 50%; background: #fff; box-shadow: 0 2cqw 6cqw #0004; }
.santolan-symbol img { display: block; width: 100%; height: auto; }
.santolan-cover-title { position: absolute; top: 31%; left: 7%; font-size: 7cqw; line-height: 1.08; letter-spacing: -.055em; }
.santolan-cover-title > span { display: block; font-size: 4.6cqw; margin-top: 1cqw; color: #f3c3cd; }
.santolan-live { position: absolute; left: 7%; bottom: 10%; display: flex; align-items: center; gap: 1cqw; color: #c9acb3; font-size: 1.2cqw; letter-spacing: .12em; }
.santolan-live > i { width: .7cqw; height: .7cqw; border-radius: 50%; background: var(--accent); }

/* The gallery shows the whole image and allows native zoom in a separate tab. */
.project-dialog { width: min(1080px, calc(100% - 32px)); }
.project-dialog .dialog-content { padding: clamp(20px, 4vw, 48px); }
.project-dialog .dialog-bar { padding: 12px clamp(20px, 4vw, 48px); }
.project-dialog .dialog-bar .eyebrow { margin: 0; }
.project-dialog .dialog-close { min-height: 44px; }
.project-dialog .dialog-close svg { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.project-dialog .dialog-intro { max-width: 720px; }
.project-dialog .work-artworks { display: grid; gap: 40px; }
.work-figure { width: 100%; min-width: 0; margin: 0 auto; }
.work-figure.is-portrait { max-width: 680px; }
.work-figure > a { display: block; }
.work-figure img { display: block; width: 100%; height: auto; border-radius: 8px; }
.work-figure figcaption { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 12px; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 40px; }
.dialog-actions > a { min-height: 44px; display: inline-flex; align-items: center; }
.dialog-actions .dialog-contact { margin: 0; }
.dialog-actions > a:first-child { text-underline-offset: 5px; font-size: 14px; }

@media (hover: none) { .work-section .project-view { opacity: 1; transform: none; font-size: 11px; padding: 8px 12px; right: 12px; bottom: 12px; } }
@media (max-width: 600px) { .dialog-actions { align-items: flex-start; flex-direction: column; }.project-dialog .dialog-content > h2 { overflow-wrap: anywhere; } }
@media (prefers-reduced-motion: reduce) { .project-open .artwork-preview > img { transition: none; transform: none !important; } }

/* Fixed controls adapt only when their own position crosses the dark section. */
.site-header.is-dark { color: var(--work-ink); background: #000000ed; box-shadow: none; }
.site-header.is-dark .rm-logo { filter: brightness(0) invert(1); }
.site-header.is-dark .identity-name { border-color: #ffffff30; }
.site-header.is-dark .nav-link { color: #aaa; }
.site-header.is-dark .nav-link:is(.is-active, :hover) { color: white; }
.site-header.is-dark .nav-link::after, .site-header.is-dark .header-contact::before, .site-header.is-dark .wave-bars i { background: currentColor; }
.site-header.is-dark .motion-toggle { border-color: #ffffff40; }
.site-header.is-dark :is(a, button):focus-visible { outline-color: var(--accent); }
.work-in-view .progress-rail > a::before { background: #ffffff40; }
.work-in-view .progress-rail > a.is-active::before { background: white; }

@media (max-width: 1100px) {
  .work-section .filter { padding-inline: 25px; }
  .work-section .project-meta { flex-direction: column; gap: 8px; }
  .work-section .project-year { padding-top: 0; }
}
@media (max-width: 760px) {
  .work-section { padding-block: 96px 72px; }
  .work-section .section-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .work-section .section-heading h2 { max-width: 560px; font-size: clamp(36px, 6.8vw, 48px); }
  .work-section .work-toolbar { margin: 26px 0 24px; }
  .work-section .filters { gap: 8px; }
  .work-section .filter { min-height: 44px; padding: 10px 22px; font-size: 14px; }
  .work-section .project-grid { grid-template-columns: minmax(0, 1fr); gap: 42px; }
  .work-section .project-tags { margin-top: 20px; font-size: 12px; }
  .work-section .project-meta { margin-top: 12px; }
  .work-section .project-title { font-size: 26px; }
  .work-section .project-view { right: 12px; bottom: 12px; font-size: 10px; padding: 5px 10px; gap: 10px; }
  .work-section .concept-note { margin-top: 42px; }
}
@media (max-width: 380px) {
  .work-section .filter { padding-inline: 17px; font-size: 13px; }
  .work-section .project-title { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .work-section .project-open:hover .browser-mockup { transform: perspective(1200px) rotateY(-9deg) rotateX(7deg) rotateZ(-5deg); }
  .work-section .project-open:hover .cosmetic-box { transform: rotate(-9deg); }
  .work-section .project-open:hover .cosmetic-tube { transform: rotate(12deg); }
  .work-section .project-open:hover .poster-front { transform: rotate(-9deg); }
  .work-section .project-open:hover .poster-back { transform: rotate(12deg); }
  .work-section .project-arrow, .view-all-arrow { transform: none !important; }
}
