:root {
  color-scheme: light;
  --paper: #f3f0e9;
  --paper-deep: #e9e4da;
  --ink: #1c1c1a;
  --muted: #77766f;
  --line: rgba(28, 28, 26, 0.16);
  --line-strong: rgba(28, 28, 26, 0.34);
  --accent: #cf5737;
  --white: #fffdf8;
  --grid-line: rgba(28, 28, 26, 0.025);
  --panel: rgba(255, 253, 248, 0.58);
  --switch-track: rgba(28, 28, 26, 0.08);
  --page-width: 1120px;
  --font-sans: "Helvetica Neue", "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-display: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "Noto Sans CJK SC", sans-serif;
  --font-serif: "Iowan Old Style", "Baskerville", "Songti SC", "STSong",
    "Noto Serif SC", serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141413;
  --paper-deep: #242422;
  --ink: #f3f0e9;
  --muted: #aaa8a0;
  --line: rgba(243, 240, 233, 0.15);
  --line-strong: rgba(243, 240, 233, 0.34);
  --accent: #ff7655;
  --white: #141413;
  --grid-line: rgba(243, 240, 233, 0.035);
  --panel: rgba(255, 255, 255, 0.035);
  --switch-track: rgba(243, 240, 233, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-width: 320px;
  height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: var(--font-sans);
  transition:
    color 200ms ease,
    background-color 200ms ease;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 40;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  font-size: 13px;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

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

.page-shell {
  display: grid;
  width: min(calc(100% - 64px), var(--page-width));
  height: 100svh;
  margin: 0 auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: clip;
}

.site-header {
  z-index: 10;
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-strong);
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: 17px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 60px;
  height: 60px;
  overflow: hidden;
  place-items: center;
  border-radius: 16px;
  background: var(--ink);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity-copy {
  display: flex;
  align-items: flex-end;
  gap: 11px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
}

.brand-caption {
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 22px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(207, 87, 55, 0.1);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.theme-switch {
  position: relative;
  display: block;
  width: 36px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--switch-track);
}

.theme-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  transition:
    background-color 200ms ease,
    transform 200ms ease;
}

html[data-theme="dark"] .theme-switch-knob {
  background: var(--accent);
  transform: translateX(16px);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--ink);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.page-viewport {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.page-panel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(100%);
  transition:
    transform 720ms cubic-bezier(0.77, 0, 0.18, 1),
    opacity 420ms ease,
    visibility 0s linear 720ms;
  will-change: transform;
}

.page-panel.is-before {
  transform: translateY(-100%);
}

.page-panel.is-after {
  transform: translateY(100%);
}

.page-panel.is-active {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.page-panel--projects {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.page-panel--home {
  overflow-y: auto;
  scrollbar-width: none;
}

.page-panel--home::-webkit-scrollbar,
.page-panel--projects::-webkit-scrollbar {
  display: none;
}

.hero {
  display: grid;
  min-height: 100%;
  grid-template-columns: minmax(0, 1.36fr) minmax(280px, 0.5fr);
  gap: clamp(36px, 5vw, 56px);
  align-items: center;
  padding: clamp(20px, 4vh, 52px) 0 clamp(46px, 6vh, 70px);
}

.eyebrow {
  display: flex;
  gap: 24px;
  margin: 0 0 25px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.eyebrow span:first-child {
  color: var(--ink);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(58px, 8vw, 108px);
  font-weight: 700;
  letter-spacing: 0.018em;
  line-height: 1.05;
}

.hero h1 span {
  display: block;
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.hero-intro {
  max-width: 560px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 0.02em;
  line-height: 1.8;
}

.notice {
  position: relative;
  align-self: center;
  padding: 25px 27px 27px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
}

.notice::before,
.notice::after {
  position: absolute;
  width: 8px;
  height: 8px;
  content: "";
}

.notice::before {
  top: -1px;
  right: -1px;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
}

.notice::after {
  bottom: -1px;
  left: -1px;
  border-bottom: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
}

.notice-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.notice-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--accent);
  font-family: var(--font-serif);
  font-size: 12px;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0;
}

.notice p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.8;
}

.notice strong {
  color: var(--accent);
  font-weight: 700;
}

.scroll-cue {
  position: absolute;
  bottom: 8px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.scroll-cue-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink);
  font-size: 12px;
}

.projects {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  padding: clamp(14px, 2.4vh, 28px) 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: clamp(16px, 2.2vh, 24px);
}

.section-heading > div {
  display: flex;
  align-items: baseline;
  gap: 15px;
}

.section-number {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-style: italic;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.section-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.project-link {
  position: relative;
  display: flex;
  min-height: clamp(78px, 11.2vh, 106px);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px 16px 4px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition:
    color 180ms ease,
    background-color 180ms ease;
}

.project-link:nth-child(odd) {
  padding-right: 24px;
  border-right: 1px solid var(--line);
}

.project-link:nth-child(even) {
  padding-left: 24px;
}

.project-link:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.project-link::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--accent);
  content: "";
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 220ms ease;
}

.project-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 17px;
}

.project-logo-stack {
  display: grid;
  flex: 0 0 62px;
  justify-items: center;
  gap: 5px;
}

.project-logo {
  display: grid;
  width: 56px;
  height: 56px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper-deep);
}

.project-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-number {
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
}

.project-copy {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.project-title {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-description {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.015em;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-side {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.project-domain {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.project-arrow {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 16px;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.project-link:hover {
  background: var(--panel);
}

.project-link:hover::before {
  transform: scaleY(1);
}

.project-link:hover .project-arrow {
  color: var(--white);
  border-color: var(--accent);
  background: var(--accent);
  transform: rotate(8deg);
}

.project-link:focus-visible {
  z-index: 1;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.page-navigation {
  position: fixed;
  z-index: 20;
  top: 50%;
  right: max(14px, calc((100vw - var(--page-width)) / 2 - 106px));
  display: grid;
  gap: 2px;
  transform: translateY(-50%);
}

.page-navigation-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.page-navigation-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.page-navigation-button.is-active {
  color: var(--ink);
}

.page-navigation-button.is-active .page-navigation-dot {
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.35);
}

.page-navigation-button:hover .page-navigation-dot {
  border-color: var(--accent);
}

.page-navigation-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-footer {
  z-index: 10;
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid var(--line-strong);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  color: var(--white);
  background: var(--ink);
  font-family: var(--font-serif);
  font-size: 17px;
  font-style: italic;
}

.footer-left p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.footer-left strong {
  color: var(--ink);
  font-weight: 500;
}

.footer-right {
  display: flex;
  flex: 0 0 auto;
  gap: 22px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

@media (max-width: 1200px) {
  .page-navigation {
    right: 12px;
  }

  .page-navigation-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(calc(100% - 40px), var(--page-width));
  }

  .site-header {
    min-height: 92px;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }

  .brand-name {
    font-size: 34px;
  }

  .header-tools {
    gap: 16px;
  }

  .header-meta span:last-child {
    display: none;
  }

  .hero {
    min-height: 100%;
    grid-template-columns: 1fr;
    gap: 26px;
    align-items: start;
    align-content: center;
    padding: 26px 0 48px;
  }

  .hero h1 {
    font-size: clamp(52px, 11vw, 80px);
  }

  .hero-intro {
    margin-top: 20px;
  }

  .notice {
    max-width: 520px;
  }

  .projects {
    justify-content: flex-start;
    padding-top: 24px;
    padding-bottom: 26px;
  }

  .project-link {
    min-height: 84px;
  }

  .project-domain {
    display: none;
  }

  .site-footer {
    min-height: 82px;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(calc(100% - 30px), var(--page-width));
  }

  .site-header {
    min-height: 82px;
  }

  .identity {
    gap: 11px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .brand-name {
    font-size: 29px;
  }

  .brand-caption {
    font-size: 10px;
  }

  .header-meta {
    display: none;
  }

  .hero {
    gap: 22px;
    padding: 20px 0 42px;
  }

  .eyebrow {
    gap: 14px;
    margin-bottom: 18px;
    font-size: 9.5px;
  }

  .hero h1 {
    font-size: clamp(46px, 12.6vw, 62px);
    line-height: 1.06;
  }

  .hero-intro {
    margin-top: 17px;
    font-size: 14px;
    line-height: 1.7;
  }

  .notice {
    padding: 18px 18px 20px;
  }

  .notice-label {
    margin-bottom: 12px;
  }

  .notice p {
    font-size: 14px;
    line-height: 1.65;
  }

  .scroll-cue {
    bottom: 6px;
    font-size: 9px;
  }

  .projects {
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .section-heading {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .section-heading h2 {
    font-size: 23px;
  }

  .section-hint {
    max-width: 105px;
    text-align: right;
    font-size: 10px;
    line-height: 1.45;
  }

  .project-list {
    grid-template-columns: 1fr;
  }

  .project-link {
    min-height: 68px;
    padding: 4px;
  }

  .project-link:nth-child(odd) {
    padding-right: 4px;
    border-right: 0;
  }

  .project-link:nth-child(even) {
    padding-left: 4px;
  }

  .project-link:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .project-link:last-child {
    border-bottom: 0;
  }

  .project-main {
    gap: 13px;
  }

  .project-logo-stack {
    flex-basis: 48px;
    gap: 3px;
  }

  .project-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .project-number {
    font-size: 13px;
  }

  .project-title {
    font-size: 19px;
  }

  .project-description {
    font-size: 12px;
  }

  .project-arrow {
    width: 28px;
    height: 28px;
  }

  .site-footer {
    min-height: 78px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
  }

  .footer-left {
    gap: 10px;
  }

  .footer-left p {
    font-size: 11px;
  }

  .footer-right {
    padding-left: 40px;
    font-size: 9.5px;
  }

  .page-navigation {
    display: none;
  }
}

@media (max-height: 700px) and (max-width: 680px) {
  .site-header {
    min-height: 72px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand-name {
    font-size: 26px;
  }

  .hero {
    padding: 12px 0 34px;
  }

  .hero h1 {
    font-size: clamp(40px, 11vw, 52px);
  }

  .eyebrow {
    margin-bottom: 12px;
  }

  .notice {
    padding: 14px 16px 16px;
  }

  .site-footer {
    min-height: 66px;
    padding: 8px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
