:root {
  color-scheme: dark;
  --bg: #050505;
  --fg: #f5f5f1;
  --muted: rgba(245, 245, 241, 0.58);
  --quiet: rgba(245, 245, 241, 0.34);
  --line: rgba(245, 245, 241, 0.13);
  --line-strong: rgba(245, 245, 241, 0.28);
  --switch-bg: rgba(245, 245, 241, 0.07);
  --switch-active: #f5f5f1;
  --switch-active-text: #070707;
  --selection: rgba(245, 245, 241, 0.22);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #090909;
  --muted: rgba(9, 9, 9, 0.62);
  --quiet: rgba(9, 9, 9, 0.36);
  --line: rgba(9, 9, 9, 0.14);
  --line-strong: rgba(9, 9, 9, 0.25);
  --switch-bg: rgba(9, 9, 9, 0.06);
  --switch-active: #090909;
  --switch-active-text: #ffffff;
  --selection: rgba(9, 9, 9, 0.13);
}

* {
  box-sizing: border-box;
}

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

html {
  min-height: 100%;
  background: var(--bg);
  overflow-x: hidden;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.018) 48%, transparent 100%),
    var(--bg);
  color: var(--fg);
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
  transition:
    background-color 420ms ease,
    color 420ms ease;
}

:root[data-theme="light"] body {
  background: #ffffff;
}

button,
a {
  font: inherit;
}

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

.site-shell {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  min-height: 100vh;
  overflow: hidden;
}

.site-shell::before,
.site-shell::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

.site-shell::before {
  background: linear-gradient(
    90deg,
    transparent 0,
    transparent calc(50% - 0.5px),
    var(--line) 50%,
    transparent calc(50% + 0.5px)
  );
  opacity: 0.7;
}

.site-shell::after {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.075), transparent 34%),
    radial-gradient(circle at 50% 86%, rgba(255, 255, 255, 0.04), transparent 28%);
  mix-blend-mode: normal;
}

:root[data-theme="light"] .site-shell::after {
  background:
    radial-gradient(circle at 50% 42%, rgba(0, 0, 0, 0.045), transparent 34%),
    radial-gradient(circle at 50% 86%, rgba(0, 0, 0, 0.028), transparent 28%);
}

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px clamp(22px, 4vw, 56px);
}

.brand {
  display: inline-flex;
  width: clamp(190px, 18vw, 270px);
  height: 72px;
  align-items: center;
}

.brand-mark {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: opacity 360ms ease;
}

.brand-mark-light,
:root[data-theme="light"] .brand-mark-dark {
  display: none;
}

:root[data-theme="light"] .brand-mark-light {
  display: block;
}

.theme-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--switch-bg);
  backdrop-filter: blur(16px);
}

.theme-option {
  min-width: 54px;
  border: 0;
  padding: 8px 10px;
  background: transparent;
  color: var(--quiet);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  text-transform: lowercase;
  transition:
    background 240ms ease,
    color 240ms ease;
}

.theme-option:hover {
  color: var(--fg);
}

.theme-option.is-active {
  background: var(--switch-active);
  color: var(--switch-active-text);
}

.hero {
  position: relative;
  display: grid;
  width: 100vw;
  max-width: 100vw;
  min-height: 104vh;
  place-items: center;
  padding: 136px clamp(24px, 6vw, 96px) 96px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(820px, 100%);
  text-align: center;
  animation: rise-in 900ms ease both;
}

h1 {
  margin: 0;
  color: var(--fg);
  font-size: clamp(38px, 6.4vw, 88px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.08;
}

h1 span {
  display: block;
}

.intro {
  width: min(720px, 100%);
  margin: 34px auto 0;
  color: var(--muted);
  font-size: clamp(15px, 1.45vw, 18px);
  font-weight: 400;
  line-height: 2.05;
}

.intro span {
  display: block;
}

.time-field {
  position: absolute;
  top: 18vh;
  left: 0;
  right: 0;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, #000 7%, #000 93%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 7%, #000 93%, transparent 100%);
  color: var(--quiet);
  font-family:
    "SF Mono",
    "Roboto Mono",
    ui-monospace,
    monospace;
  font-size: clamp(11px, 1.2vw, 13px);
  opacity: 0.52;
}

.time-track {
  --cycle-width: max(1200px, 100vw);
  display: flex;
  width: max-content;
  animation: drift-time 36s linear infinite;
}

.time-cycle {
  position: relative;
  display: grid;
  width: var(--cycle-width);
  grid-template-columns: repeat(12, 1fr);
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.time-cycle::before,
.time-cycle::after {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  content: "";
  background-position: 0 0;
  background-repeat: repeat-x;
  pointer-events: none;
}

.time-cycle::before {
  height: 18px;
  background-image: linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px);
  background-size: calc(var(--cycle-width) / 24) 18px;
}

.time-cycle::after {
  height: 9px;
  background-image: linear-gradient(90deg, var(--line) 0 1px, transparent 1px);
  background-size: calc(var(--cycle-width) / 48) 9px;
}

.time-cycle span {
  min-width: 0;
  transform: translateX(-0.28em);
}

.project-section {
  position: relative;
  z-index: 2;
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 86px;
}

.section-label {
  margin: 0 0 18px;
  color: var(--quiet);
  font-size: 13px;
}

.project-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition:
    border-color 240ms ease,
    transform 240ms ease;
}

.project-link:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

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

.project-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
}

.project-logo-light,
:root[data-theme="light"] .project-logo-dark {
  display: none;
}

:root[data-theme="light"] .project-logo-light {
  display: block;
}

.project-name,
.project-desc {
  display: block;
}

.project-name {
  color: var(--fg);
  font-size: clamp(18px, 1.55vw, 22px);
  font-weight: 500;
  line-height: 1.2;
}

.project-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.project-action {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  padding: 10px 18px;
  color: var(--fg);
  font-size: 14px;
  line-height: 1;
  transition:
    background 240ms ease,
    color 240ms ease,
    border-color 240ms ease;
}

.project-link:hover .project-action {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
  padding: 26px 24px 40px;
  color: var(--quiet);
  font-size: 12px;
}

.site-footer a {
  transition: color 220ms ease;
}

.site-footer a:hover {
  color: var(--muted);
}

@keyframes drift-time {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(var(--cycle-width) * -1));
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 720px) {
  .site-header {
    gap: 18px;
    padding: 22px 20px;
  }

  .brand {
    width: 152px;
  }

  .theme-switch {
    flex: 0 0 auto;
  }

  .theme-option {
    min-width: 42px;
    padding: 8px 7px;
  }

  .hero {
    min-height: 104vh;
    padding: 118px 24px 76px;
  }

  .intro {
    width: min(342px, 100%);
    margin-top: 30px;
    line-height: 1.9;
    overflow-wrap: anywhere;
  }

  .time-field {
    top: 16vh;
  }

  .project-section {
    width: calc(100% - 40px);
    padding-bottom: 64px;
  }

  .project-link {
    align-items: flex-start;
    gap: 24px;
    padding: 24px 0;
  }

  .project-identity {
    gap: 14px;
  }

  .project-logo {
    width: 31px;
    height: 31px;
  }

  .project-action {
    padding: 9px 13px;
    white-space: nowrap;
  }
}

@media (max-width: 430px) {
  .project-link {
    flex-direction: column;
  }

  .project-action {
    align-self: flex-start;
  }
}
