:root {
  color-scheme: light;
  --background: #faf9f7;
  --surface: #f2f0ea;
  --surface-raised: #ffffff;
  --ink: #1c1b1a;
  --text: #4f4c46;
  --muted: #716d66;
  --line: #dfdcd5;
  --line-soft: #e8e5de;
  --button-bg: #1c1b1a;
  --button-text: #faf9f7;
  --focus: #705f46;
  --success: #3d6a4f;
  --progress: #8a5a3c;
  --shadow: 0 24px 64px rgba(33, 29, 24, 0.16);
  --header-bg: rgba(250, 249, 247, 0.88);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --max-width: 1440px;
  --content-width: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-space: clamp(64px, 8vw, 112px);
  --font-serif: "Noto Serif TC", "Songti TC", Georgia, serif;
  --font-sans: "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --background: #171614;
  --surface: #1e1c1a;
  --surface-raised: #26231f;
  --ink: #f0eee9;
  --text: #c4c0b8;
  --muted: #a09b91;
  --line: #37332f;
  --line-soft: #2c2925;
  --button-bg: #f0eee9;
  --button-text: #171614;
  --focus: #d8b985;
  --success: #99c6aa;
  --progress: #d6a47f;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
  --header-bg: rgba(23, 22, 20, 0.88);
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--background);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.dialog-open,
body.menu-open {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
ul {
  margin-top: 0;
}

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

::selection {
  background: var(--ink);
  color: var(--background);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 16px;
  transform: translateY(-160%);
  border-radius: var(--radius-sm);
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(100%, var(--max-width));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.content-shell {
  width: min(100%, var(--content-width));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow,
.section-label,
.section-range,
.mono-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.5;
  text-transform: uppercase;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 72px;
  gap: 12px;
}

.brand {
  position: relative;
  z-index: 2;
  width: fit-content;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.primary-nav {
  position: absolute;
  top: calc(100% + 1px);
  left: calc(var(--gutter) * -1);
  right: calc(var(--gutter) * -1);
  display: none;
  flex-direction: column;
  padding: 20px calc(var(--gutter) * 2) 32px;
  border-bottom: 1px solid var(--line);
  background: var(--background);
  box-shadow: 0 18px 28px rgba(20, 18, 15, 0.08);
}

.primary-nav[data-open="true"] {
  display: flex;
}

.primary-nav__link {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding-block: 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 0.94rem;
}

.primary-nav__link:last-child {
  border-bottom: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.control-button,
.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.control-button:hover,
.menu-button:hover {
  border-color: var(--muted);
  color: var(--ink);
}

.control-button--language {
  min-width: 52px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.control-button svg,
.menu-button svg {
  width: 19px;
  height: 19px;
}

.menu-button {
  padding: 0;
}

.menu-button[aria-expanded="true"] .menu-button__open,
.menu-button[aria-expanded="false"] .menu-button__close {
  display: none;
}

.hero {
  border-bottom: 1px solid var(--line);
}

.hero__inner {
  display: grid;
  gap: 48px;
  align-items: center;
  min-height: calc(100dvh - 72px);
  padding-top: clamp(64px, 10vw, 120px);
  padding-bottom: clamp(64px, 9vw, 104px);
}

.hero__copy {
  max-width: 760px;
}

.hero__title {
  max-width: 850px;
  margin: 24px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 12vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.13;
  white-space: pre-line;
  text-wrap: balance;
}

.hero__description {
  max-width: 540px;
  margin: 28px 0 0;
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.1rem);
  line-height: 1.85;
}

.hero__actions,
.project-hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  gap: 8px;
  padding: 11px 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--muted);
}

.button:active {
  transform: translateY(0);
}

.button--primary {
  border-color: var(--button-bg);
  background: var(--button-bg);
  color: var(--button-text);
}

.button--secondary {
  background: transparent;
  color: var(--ink);
}

.hero__portrait-wrap {
  position: relative;
  justify-self: center;
  width: min(82vw, 330px);
  aspect-ratio: 0.82;
}

.hero__portrait-wrap::before {
  position: absolute;
  inset: -18px;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(31, 28, 24, 0.11), rgba(176, 172, 163, 0.18));
  content: "";
  filter: blur(25px);
}

html[data-theme="dark"] .hero__portrait-wrap::before {
  background: linear-gradient(135deg, rgba(240, 238, 233, 0.1), rgba(240, 238, 233, 0.03));
}

.hero__portrait {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  object-fit: cover;
  object-position: center;
}

.profile-section {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.profile-section__grid {
  display: grid;
}

.about-panel,
.profile-panel {
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}

.about-title {
  max-width: 620px;
  margin: 20px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 5vw, 2.25rem);
  font-weight: 600;
  line-height: 1.5;
  text-wrap: balance;
}

.about-copy {
  display: grid;
  max-width: 720px;
  gap: 20px;
  margin-top: 28px;
}

.about-copy__paragraph {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.95;
}

.about-copy__highlight {
  font-size: calc(1em + 2px);
  font-weight: 700;
}

.profile-panel {
  display: grid;
  align-content: start;
  gap: 48px;
  border-top: 1px solid var(--line);
}

.profile-list,
.education-list {
  display: grid;
  margin-top: 10px;
}

.profile-row,
.education-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.8fr) minmax(0, 2fr);
  gap: 20px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}

.profile-row {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: clamp(8px, 2vw, 20px);
  align-items: center;
}

.profile-row:last-child,
.education-row:last-child {
  border-bottom: 0;
}

.profile-row__label,
.education-row__source,
.education-row__date {
  color: var(--muted);
}

.profile-row__label {
  font-size: clamp(0.625rem, 1.15vw, 0.88rem);
  white-space: nowrap;
}

.profile-row__value {
  min-width: 0;
  font-size: clamp(0.625rem, 1.15vw, 0.92rem);
  line-height: 1.45;
  letter-spacing: -0.012em;
  text-align: right;
  white-space: nowrap;
}

.education-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.education-row__title {
  font-size: 0.94rem;
}

.education-row__source {
  margin-top: 4px;
  font-size: 0.78rem;
}

.education-row__date {
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  white-space: nowrap;
}

.experience-section,
.work-section,
.contact-section {
  border-bottom: 1px solid var(--line);
}

.experience-section__inner,
.work-section__inner {
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}

.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.experience-list {
  display: grid;
}

.experience-item {
  display: grid;
  gap: 20px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line-soft);
}

.experience-item:last-child {
  border-bottom: 0;
}

.experience-item__date {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.experience-item__role {
  margin-bottom: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 4vw, 1.7rem);
  font-weight: 600;
  line-height: 1.35;
}

.experience-item__company {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.experience-item__description {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.9;
}

.work-section {
  background: var(--surface);
}

.work-intro {
  max-width: 650px;
  margin: 12px 0 36px;
  color: var(--text);
  font-size: 0.94rem;
}

.project-list {
  display: grid;
}

.project-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  transition: color 180ms ease;
}

.project-row:first-child {
  border-top: 1px solid var(--line);
}

.project-row:hover .project-row__number,
.project-row:hover .project-row__title,
.project-row:hover .project-row__action,
.project-row:focus-visible .project-row__number,
.project-row:focus-visible .project-row__title,
.project-row:focus-visible .project-row__action {
  color: var(--project-accent);
}

.project-row:hover .project-row__logo,
.project-row:focus-visible .project-row__logo {
  border-color: var(--project-accent);
}

.project-row__number {
  padding-top: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  transition: color 180ms ease;
}

.project-row__identity {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.project-row__logo,
.project-hero__logo-frame {
  display: grid;
  overflow: hidden;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border-color 180ms ease;
}

.project-row__logo img,
.project-hero__logo-frame img {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  object-fit: contain;
}

.project-row__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 5vw, 1.65rem);
  font-weight: 600;
  line-height: 1.3;
  transition: color 180ms ease;
}

.project-row__summary {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.project-row__meta {
  display: flex;
  grid-column: 2;
  flex-wrap: nowrap;
  gap: 10px clamp(8px, 3vw, 18px);
  align-items: center;
  margin-top: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: clamp(4px, 1.6vw, 7px);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: clamp(0.625rem, 2.7vw, 0.69rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status__dot {
  width: clamp(5px, 1.8vw, 7px);
  height: clamp(5px, 1.8vw, 7px);
  border: 1px solid currentColor;
  border-radius: 50%;
  background: currentColor;
}

.status--completed {
  color: var(--success);
}

.status--inProgress {
  color: var(--progress);
}

.project-row__tags {
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: clamp(0.625rem, 2.65vw, 0.68rem);
  line-height: 1.6;
  letter-spacing: -0.012em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.project-row__action {
  display: none;
  transition: color 180ms ease;
}

.contact-section__inner {
  padding-top: clamp(88px, 11vw, 144px);
  padding-bottom: clamp(88px, 11vw, 144px);
  text-align: center;
}

.contact-section__title {
  max-width: 760px;
  margin: 22px auto 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 7vw, 3.4rem);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}

.contact-section__description {
  max-width: 600px;
  margin: 16px auto 0;
  color: var(--text);
}

.contact-email {
  display: inline-block;
  margin-top: 32px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--muted);
  font-family: var(--font-mono);
  font-size: clamp(1rem, 4vw, 1.35rem);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 28px;
  margin-top: 28px;
  color: var(--text);
  font-size: 0.88rem;
}

.contact-links a,
.site-footer a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 180ms ease;
}

.contact-links a:hover,
.site-footer a:hover {
  text-decoration-color: currentColor;
}

.site-footer__inner {
  display: grid;
  gap: 12px;
  padding-top: 28px;
  padding-bottom: 28px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms ease-out, transform 420ms ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Project detail */
.project-page .site-header__inner {
  grid-template-columns: 1fr auto;
}

.project-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  width: fit-content;
  color: var(--text);
  font-size: 0.88rem;
}

.project-back svg {
  width: 18px;
  height: 18px;
}

.project-hero {
  border-bottom: 1px solid var(--line);
}

.project-hero__inner {
  padding-top: clamp(64px, 9vw, 112px);
  padding-bottom: clamp(64px, 8vw, 96px);
}

.project-hero__identity {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-top: 24px;
}

.project-hero__logo-frame {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: 8px;
  border-radius: 19px;
}

.project-hero__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 10vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.project-hero__summary {
  max-width: 790px;
  margin: 28px 0 0;
  color: var(--text);
  font-size: clamp(1rem, 2.4vw, 1.12rem);
  line-height: 1.85;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.project-gallery-section {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.project-gallery-section__inner {
  padding-top: clamp(48px, 7vw, 72px);
  padding-bottom: clamp(48px, 7vw, 72px);
}

.gallery-carousel {
  position: relative;
}

.gallery-nav {
  display: none;
}

.screen-grid {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  padding-bottom: 12px;
  overflow-x: auto;
  scroll-padding-inline: var(--gutter);
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.screen-card {
  flex: 0 0 min(76vw, 300px);
  overflow: hidden;
  width: 100%;
  margin: 0;
  padding: 12px 12px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--project-accent) 8%, var(--surface-raised));
  scroll-snap-align: start;
}

.screen-card img {
  width: 100%;
  height: auto;
  border-radius: 11px 11px 0 0;
}

.gallery-empty {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 260px;
  margin-top: 24px;
  padding: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--project-accent) 25%, transparent), transparent 42%),
    linear-gradient(135deg, var(--surface-raised), color-mix(in srgb, var(--project-accent) 8%, var(--surface)));
  color: var(--text);
  text-align: center;
}

.gallery-empty::before,
.gallery-empty::after {
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--project-accent) 28%, var(--line));
  border-radius: 50%;
  content: "";
}

.gallery-empty::before {
  width: 220px;
  height: 220px;
  top: -120px;
  right: -60px;
}

.gallery-empty::after {
  width: 120px;
  height: 120px;
  bottom: -70px;
  left: 12%;
}

.project-overview__grid {
  display: grid;
  gap: 48px;
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}

.project-description {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.95;
}

.numbered-list,
.technology-list {
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.numbered-list__item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.75;
}

.numbered-list__number {
  padding-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.project-technology {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.project-technology__inner {
  padding-top: clamp(48px, 7vw, 72px);
  padding-bottom: clamp(48px, 7vw, 72px);
}

.technology-list {
  display: grid;
  margin-top: 20px;
}

.technology-list__item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.7;
}

.next-project-wrap {
  padding-top: 20px;
  padding-bottom: 40px;
}

.next-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 132px;
  padding: 26px 8px;
  border-radius: var(--radius-sm);
  transition: background-color 180ms ease, padding-inline 180ms ease;
}

.next-project:hover {
  padding-inline: 18px;
  background: var(--surface);
}

.next-project__name {
  display: block;
  margin: 8px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 6vw, 2.2rem);
  font-weight: 600;
}

[hidden] {
  display: none !important;
}

@media (min-width: 600px) {
  .site-footer__inner {
    grid-template-columns: 1fr auto;
    text-align: left;
  }

  .site-footer__inner span:last-child {
    text-align: right;
  }

  .screen-grid {
    gap: 18px;
  }
}

@media (min-width: 768px) {
  body.menu-open {
    overflow: auto;
  }

  .site-header__inner {
    grid-template-columns: 1fr auto auto;
    gap: 32px;
  }

  .primary-nav,
  .primary-nav[data-open="true"] {
    position: static;
    display: flex;
    flex-direction: row;
    gap: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .primary-nav__link {
    min-height: 44px;
    padding: 0;
    border: 0;
    font-size: 0.86rem;
  }

  .primary-nav__link:hover {
    color: var(--ink);
  }

  .menu-button {
    display: none;
  }

  .hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: clamp(48px, 7vw, 96px);
  }

  .hero__title {
    font-size: clamp(3.6rem, 7vw, 5.4rem);
  }

  .experience-item {
    grid-template-columns: 150px minmax(210px, 0.9fr) minmax(0, 1.4fr);
    gap: 28px;
  }

  .experience-item__date {
    padding-top: 6px;
  }

  .project-row {
    grid-template-columns: 32px minmax(0, 1fr) minmax(230px, 0.7fr);
    gap: 22px;
    align-items: center;
    padding-block: 28px;
  }

  .project-row__number {
    padding-top: 0;
  }

  .project-row__identity {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 20px;
  }

  .project-row__logo {
    width: 58px;
    height: 58px;
  }

  .project-row__meta {
    grid-column: auto;
    flex-direction: row;
    align-items: center;
    margin-top: 0;
  }

  .project-row__action {
    display: none;
  }

  .screen-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  .screen-card {
    flex-basis: auto;
  }

  .gallery-carousel[data-scrollable="true"] .screen-grid {
    display: flex;
    overflow-x: auto;
    scroll-padding-inline: 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .gallery-carousel[data-scrollable="true"] .screen-grid::-webkit-scrollbar {
    display: none;
  }

  .gallery-carousel[data-scrollable="true"] .screen-card {
    flex: 0 0 calc((100% - 54px) / 4);
    min-width: 0;
  }

  .gallery-carousel[data-scrollable="true"] .gallery-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: inline-grid;
    width: 48px;
    height: 48px;
    padding: 0;
    transform: translateY(-50%);
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
    box-shadow: 0 10px 28px rgba(33, 29, 24, 0.18);
    color: var(--ink);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, background-color 180ms ease, transform 180ms ease;
    backdrop-filter: blur(10px);
  }

  .gallery-nav--previous {
    left: 16px;
  }

  .gallery-nav--next {
    right: 16px;
  }

  .gallery-carousel[data-scrollable="true"] .gallery-nav:focus-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .gallery-carousel[data-scrollable="true"] .gallery-nav:hover:not(:disabled) {
    transform: translateY(-50%) scale(1.06);
    background: var(--surface-raised);
  }

  .gallery-carousel[data-scrollable="true"] .gallery-nav:disabled {
    cursor: default;
    opacity: 0;
    pointer-events: none;
  }

  .project-overview__grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(48px, 7vw, 88px);
  }

  .technology-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 64px;
  }

  .project-hero__logo-frame {
    width: 80px;
    height: 80px;
  }

  .gallery-empty {
    min-height: 320px;
  }
}

@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .gallery-carousel[data-scrollable="true"]:hover .gallery-nav {
    opacity: 1;
    pointer-events: auto;
  }

  .gallery-carousel[data-scrollable="true"]:hover .gallery-nav:disabled {
    opacity: 0.28;
    pointer-events: none;
  }
}

@media (min-width: 1024px) {
  .profile-section__grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  }

  .about-panel {
    padding-right: clamp(48px, 6vw, 88px);
    border-right: 1px solid var(--line);
  }

  .profile-panel {
    padding-left: clamp(48px, 6vw, 88px);
    border-top: 0;
  }

  .project-row {
    grid-template-columns: 34px minmax(0, 1fr) minmax(300px, 0.65fr) 112px;
  }

  .project-row__action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-size: 0.82rem;
  }

  .project-row__action .icon {
    transition: transform 180ms ease;
  }

  .project-row:hover .project-row__action .icon {
    transform: translateX(4px);
  }
}

@media (max-width: 430px) {
  .hero__actions .button {
    width: 100%;
  }

  .project-row__identity {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 13px;
  }

  .project-row__logo {
    width: 48px;
    height: 48px;
  }

  .project-row__title {
    font-size: 1.25rem;
  }

  .project-row__summary {
    font-size: 0.8rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .hero__actions,
  .contact-section,
  .site-footer,
  .next-project-wrap,
  .project-hero__links {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .hero__inner {
    min-height: auto;
  }
}
