/* ========================================
   Eone — Personal Homepage Stylesheet
   ======================================== */

:root {
  --paper: #fefdf8;
  --ink: #161512;
  --ink-soft: #3d3932;
  --muted: #7a7469;
  --faint: #b4ada0;
  --line: rgba(22, 21, 18, 0.16);
  --line-soft: rgba(22, 21, 18, 0.08);
  --accent: #1f5f6f;
  --accent-wash: rgba(31, 95, 111, 0.055);
  --max: 1120px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, Georgia, "Times New Roman", serif;
  --mono: "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --topbar-bg: rgba(254, 253, 248, .88);
}

/* ---------- Dark Mode ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141310;
    --ink: #e8e4d9;
    --ink-soft: #c4bfae;
    --muted: #8a8477;
    --faint: #5e594e;
    --line: rgba(232, 228, 217, 0.14);
    --line-soft: rgba(232, 228, 217, 0.07);
    --accent: #5cb8c9;
    --accent-wash: rgba(92, 184, 201, 0.08);
    --topbar-bg: rgba(20, 19, 16, .92);
  }
  body::before {
    background:
      radial-gradient(circle at 78% 8%, rgba(92,184,201,.035), transparent 28%),
      linear-gradient(90deg, rgba(232,228,217,.012) 1px, transparent 1px) !important;
    background-size: auto, 84px 84px !important;
  }
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
  line-height: 1.78;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 78% 8%, rgba(31,95,111,.045), transparent 28%),
    linear-gradient(90deg, rgba(22,21,18,.014) 1px, transparent 1px);
  background-size: auto, 84px 84px;
  opacity: .7;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-wash); color: var(--accent); }

/* ---------- Layout ---------- */

.page {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  position: relative;
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 58px;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .35s ease;
}
.topbar.scrolled { border-bottom-color: var(--line-soft); }
.brand {
  font-size: 22px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -.02em;
}
.nav {
  display: flex;
  gap: 24px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav a { transition: color .25s ease; }
.nav a:hover { color: var(--ink); }

/* ---------- Shared Mono Style ---------- */

.mono, .kicker, .issue-line, .hero-actions, .meta-label, .section-kicker, .run-in, .work-tag, .contact-links, .footer-note {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .11em;
}

/* ---------- Hero ---------- */

.hero {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: clamp(38px, 6vw, 76px);
  align-items: center;
  padding: 46px 0 48px;
  border-bottom: 1px solid var(--line);
}
.issue-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 22px;
}
.issue-line span:not(:last-child)::after {
  content: "/";
  margin-left: 16px;
  color: var(--faint);
}
h1 {
  margin: 0;
  max-width: 790px;
  font-size: clamp(46px, 5.7vw, 78px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -.052em;
}
.hero-subtitle {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: clamp(18px, 1.85vw, 24px);
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: -.026em;
}
.hero-deck {
  max-width: 720px;
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1.7;
}
.hero-deck::first-letter {
  float: left;
  margin: .1em .16em 0 0;
  font-size: 2.8em;
  line-height: .8;
  color: var(--ink);
}

/* ---------- Hero Actions ---------- */

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 32px;
  font-size: 13px;
}
.hero-actions a {
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 3px;
  color: var(--ink);
  transition: color .25s ease, border-color .25s ease, gap .25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.hero-actions a::after {
  content: '→';
  opacity: 0;
  margin-left: -8px;
  transition: opacity .25s ease, margin-left .25s ease;
}
.hero-actions a:hover {
  color: var(--accent);
  gap: 6px;
}
.hero-actions a:hover::after {
  opacity: 1;
  margin-left: 0;
}

/* ---------- Avatar & Editor Note ---------- */

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--line);
  margin-bottom: 20px;
  display: block;
  transition: border-color .35s ease;
}
.avatar:hover { border-color: var(--accent); }

.editor-note {
  align-self: start;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.editor-note p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.82;
}
.editor-note .meta-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 18px;
}
.fact-list {
  margin-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.fact-row {
  display: grid;
  grid-template-columns: 102px 1fr;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.fact-row .meta-label { color: var(--faint); font-size: 10px; }
.fact-row span:last-child { color: var(--ink-soft); font-size: 14px; line-height: 1.65; }

/* ---------- Sections ---------- */

.section {
  padding: 82px 0;
  border-bottom: 1px solid var(--line);
}
.section-shell {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
  gap: clamp(42px, 8vw, 104px);
  align-items: start;
}
.section-kicker {
  color: var(--accent);
  font-size: 11px;
  margin-bottom: 20px;
}
h2 {
  margin: 0;
  max-width: 430px;
  font-size: clamp(28px, 3.8vw, 48px);
  font-weight: 500;
  letter-spacing: -.048em;
  line-height: 1.04;
}
.section-lede {
  margin: 0;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1.7;
}
.section-lede + .section-lede { margin-top: 26px; }

/* ---------- Brief List ---------- */

.brief-list {
  margin-top: 44px;
  border-top: 1px solid var(--line);
}
.brief-list:first-child {
  margin-top: 0;
  border-top: none;
}
.brief-item {
  display: grid;
  grid-template-columns: 136px 1fr;
  gap: 28px;
  padding: 25px 0 25px 18px;
  border-bottom: 1px solid var(--line-soft);
  border-left: 2px solid transparent;
  transition: border-color .25s ease, background .25s ease;
  align-items: baseline;
}
.brief-item:hover {
  border-left-color: var(--accent);
}
.run-in {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.brief-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.95;
}

/* ---------- Works ---------- */

.work-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

.works-header { margin-bottom: 0; }
.works-header .section-kicker { margin-bottom: 24px; }
.works-header h2 { margin: 0 0 20px; max-width: 520px; }
.works-header .section-lede { max-width: 560px; }

.work-item {
  background: var(--paper);
  padding: 28px 28px 30px 28px;
  border-bottom: none;
  border-left: 3px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.work-item:hover {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--paper));
}
.work-tag {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
}
.work-item h3 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 500;
  letter-spacing: -.032em;
  line-height: 1.2;
}
.work-item h3 a {
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.work-item:hover h3 a { border-bottom-color: var(--accent); }
.work-item p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.95;
  font-size: 16px;
}

/* ---------- Contact ---------- */

.contact-section .section-shell { align-items: start; }
.contact-section .section-shell > div:first-child { margin-top: -40px; }
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-top: 42px;
  font-size: 12px;
}
.contact-links a {
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  transition: color .25s ease, border-color .25s ease;
}
.contact-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Footer ---------- */

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 34px 0 48px;
  color: var(--muted);
  font-size: 13px;
}
.footer-note { font-size: 11px; color: var(--faint); }
.back-top {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 3px;
  transition: color .25s ease, border-color .25s ease;
}
.back-top:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Animation ---------- */

.fade-in {
  opacity: 1;
  transform: none;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .page { width: min(100% - 34px, var(--max)); }
  .nav { gap: 14px; font-size: 10px; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 74px 0 82px; }
  .editor-note { max-width: 680px; }
  .section { padding: 78px 0; }
  .section-shell { grid-template-columns: 1fr; gap: 28px; }
  h2 { max-width: 720px; }
  .work-list { grid-template-columns: 1fr; }
  footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .topbar { min-height: 58px; }
  .nav { gap: 10px; font-size: 9px; letter-spacing: .06em; }
  h1 { font-size: clamp(48px, 15vw, 72px); }
  .hero-subtitle { font-size: 17px; line-height: 1.75; }
  .hero-deck::first-letter { float: none; margin: 0; font-size: 1em; line-height: inherit; }
  .avatar { width: 100px; height: 100px; }
  .fact-row, .brief-item { grid-template-columns: 1fr; gap: 6px; }
  .brief-item { padding-left: 14px; }
  .section-lede { font-size: 17px; }
}
