@layer base, scene, type, details, responsive;

@layer base {
  :root {
    color-scheme: dark;
    --ink: #101217;
    --paper: #f0eae2;
    --muted: #aaa6a1;
    --line: rgba(240, 234, 226, .18);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--ink);
    color: var(--paper);
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
  }
  * { box-sizing: border-box; }
  html { min-height: 100%; background: var(--ink); }
  body { margin: 0; min-width: 320px; }
  .page {
    width: min(100% - 9vw, 1450px);
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
  }
}

@layer scene {
  body {
    background:
      radial-gradient(ellipse 38% 45% at 90% 37%, rgba(87, 57, 53, .15), transparent 90%),
      linear-gradient(125deg, #101217 8%, #15171c 48%, #0d1015 100%);
  }
  .hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    flex: 1;
    min-height: 530px;
    overflow: hidden;
  }
  .hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(90deg, #101217 2%, rgba(16, 18, 23, .95) 21%, rgba(16, 18, 23, .12) 75%, transparent 100%);
    pointer-events: none;
  }
  .halo {
    position: absolute;
    z-index: -2;
    width: min(64vw, 850px);
    aspect-ratio: 1;
    right: -4%;
    top: 50%;
    transform: translateY(-50%) rotate(-14deg);
    border-radius: 50%;
    background:
      radial-gradient(circle at 30% 22%, rgba(255, 232, 179, .95) 0%, rgba(239, 177, 124, .86) 10%, transparent 31%),
      radial-gradient(circle at 40% 36%, #e7ac81 0%, #b27670 27%, #614555 51%, #262334 68%, transparent 70%);
    box-shadow:
      0 0 0 1px rgba(243, 195, 153, .12),
      0 0 0 18px rgba(243, 195, 153, .018),
      0 0 0 52px rgba(243, 195, 153, .015),
      -35px 30px 150px rgba(196, 105, 82, .10);
    opacity: .88;
    animation: arrive 1300ms cubic-bezier(.2, .7, .1, 1) both;
  }
  .halo::before, .halo::after {
    content: "";
    position: absolute;
    inset: -8%;
    border: 1px solid rgba(238, 191, 163, .14);
    border-radius: 50%;
    transform: scaleX(1.08) rotate(25deg);
  }
  .halo::after {
    inset: -19%;
    transform: scaleY(.87) rotate(-27deg);
    border-color: rgba(238, 191, 163, .07);
  }
  @keyframes arrive {
    from { opacity: 0; transform: translate(7%, -46%) rotate(-14deg) scale(.93); }
    to { opacity: .88; transform: translate(0, -50%) rotate(-14deg) scale(1); }
  }
}

@layer type {
  .masthead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding-top: clamp(29px, 5vh, 65px);
  }
  .masthead h1 {
    margin: 0;
    font-size: clamp(1.03rem, 1.5vw, 1.35rem);
    font-weight: 500;
    letter-spacing: .14em;
  }
  .today, .overline, .last-detail, .traces-heading, .trace-number, .trace-time {
    font-size: clamp(.75rem, 1vw, .88rem);
    letter-spacing: .08em;
  }
  .today { color: var(--muted); font-variant-numeric: tabular-nums; }
  .hero-content {
    position: relative;
    z-index: 1;
    max-width: 100%;
    padding: 65px 0 90px;
    animation: type-in 900ms 120ms both;
  }
  .overline { margin: 0 0 clamp(15px, 2vw, 27px); color: #d5b59f; }
  .time-lockup { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 22px; }
  .time-value {
    font-family: "Iowan Old Style", "Baskerville", "Times New Roman", "Songti SC", serif;
    font-size: clamp(9rem, 23vw, 21rem);
    font-weight: 400;
    letter-spacing: -.105em;
    line-height: .83;
    font-variant-numeric: lining-nums tabular-nums;
    white-space: nowrap;
    padding-right: .11em;
  }
  .time-value.is-word {
    font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
    font-size: clamp(5rem, 12vw, 11rem);
    letter-spacing: -.1em;
    padding-right: 0;
  }
  .time-value.is-empty { font-size: clamp(4rem, 9vw, 8rem); opacity: .5; }
  .time-unit {
    color: #d6c6bc;
    font-size: clamp(1.1rem, 2.2vw, 1.65rem);
    font-weight: 300;
    letter-spacing: .05em;
    white-space: nowrap;
  }
  .last-detail { margin: clamp(34px, 5vh, 65px) 0 0; color: #bcb4af; line-height: 1.8; }
  @keyframes type-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@layer details {
  .traces { margin-bottom: clamp(48px, 8vh, 100px); }
  .traces-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    color: #d8d0c8;
    padding-bottom: 19px;
    border-bottom: 1px solid var(--line);
  }
  .traces-heading h2 { margin: 0; font: inherit; }
  #connection { color: var(--muted); text-align: right; }
  .trace-list { list-style: none; margin: 0; padding: 0; }
  .trace-list li {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 16px;
    padding: clamp(18px, 3vh, 28px) 0;
    border-bottom: 1px solid var(--line);
  }
  .trace-number { color: #8b817d; font-variant-numeric: tabular-nums; }
  .trace-name { font-size: clamp(1.16rem, 2vw, 1.6rem); letter-spacing: .025em; overflow-wrap: anywhere; }
  .trace-time { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
  .trace-list .empty { display: block; color: var(--muted); font-size: .9rem; }
}

@layer responsive {
  @media (max-width: 700px) {
    .page { width: calc(100% - 42px); }
    .masthead { padding-top: 31px; }
    .hero { align-items: flex-end; min-height: min(68svh, 650px); }
    .hero-content { padding: 0 0 94px; }
    .halo { width: 105vw; right: -44%; top: 40%; opacity: .72; }
    .hero::after { background: linear-gradient(0deg, #101217 3%, rgba(16, 18, 23, .72) 35%, rgba(16, 18, 23, .22) 100%); }
    .time-value { font-size: clamp(8.5rem, 35vw, 14rem); }
    .time-value.is-word { font-size: clamp(4.5rem, 18vw, 7rem); }
    .time-unit { width: 100%; margin: 20px 0 0 3px; font-size: 1.15rem; }
    .last-detail { margin-top: 28px; }
    .trace-list li { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; }
    .trace-time { font-size: .75rem; }
  }
  @media (max-width: 380px) {
    .today { font-size: .7rem; }
    .trace-list li { grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  }
}
