 :root {
  --ink: #2f494c;
  --ink-strong: #173033;
  --muted: #75878a;
  --mist: rgba(255, 255, 255, 0.38);
  --mist-strong: rgba(255, 255, 255, 0.62);
  --line: rgba(255, 255, 255, 0.72);
  --aqua: #37c7b6;
  --aqua-deep: #20a99d;
  --sun: #f4d36f;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Text — ink with varying opacity */
  --text-faint: rgba(47, 73, 76, 0.58);
  --text-muted: rgba(47, 73, 76, 0.62);
  --text-subtle: rgba(47, 73, 76, 0.68);
  --text-soft: rgba(47, 73, 76, 0.72);
  --text-body: rgba(47, 73, 76, 0.84);

  /* Surface background opacity variants */
  --surface-sm: rgba(255, 255, 255, 0.28);
  --surface-md: rgba(255, 255, 255, 0.52);
  --surface-hover: rgba(255, 255, 255, 0.58);

  /* Shadows */
  --shadow-sm: 0 24px 70px rgba(35, 69, 73, 0.095);
  --shadow-hover: 0 30px 80px rgba(35, 69, 73, 0.13);

  /* Borders */
  --border-strong: rgba(255, 255, 255, 0.8);

  /* Animation timing */
  --anim-rail-morph: 680ms;
  --anim-rise: 760ms;
  --anim-rise-nav: 700ms;
  --anim-detail-settle: 560ms;
  --anim-nav-item: 520ms;
  --anim-reveal-offset: 170ms;
  --anim-trail-offset: 40ms;

  /* Stage layout (shared with .site-rail for FLIP calc) */
  --stage-max-w: 1440px;
  --stage-max-h: 860px;
  --stage-pad: 64px;
  --profile-left: 86px;
  --mx: 0.5;
  --my: 0.5;
  --profile-top: 122px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: #edf5ef;
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 19% 78%, rgba(244, 211, 111, 0.38), transparent 29%),
    radial-gradient(circle at 78% 76%, rgba(55, 199, 182, 0.24), transparent 31%),
    radial-gradient(circle at 66% 17%, rgba(255, 255, 255, 0.88), transparent 25%),
    linear-gradient(145deg, #f4f1e8 0%, #eef5ef 48%, #e2f2ed 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image:
    radial-gradient(circle, rgba(23, 48, 51, 0.45) 0 0.7px, transparent 0.8px),
    radial-gradient(circle, rgba(23, 48, 51, 0.22) 0 0.6px, transparent 0.7px);
  background-position: 0 0, 28px 32px;
  background-size: 92px 92px, 136px 136px;
  mix-blend-mode: multiply;
}

body.home-page { overflow: hidden; }
body.inner-page, body.article-page { overflow-x: hidden; }

a { color: inherit; text-decoration: none; }

.glass {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--line);
  background: var(--mist);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
  transition: box-shadow 400ms var(--ease), border-color 400ms var(--ease);
}

.glass::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(145deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.08) 35%,
    transparent 50%,
    rgba(55, 199, 182, 0.10) 75%,
    rgba(55, 199, 182, 0.20) 100%);
  pointer-events: none;
  z-index: 0;
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.rise {
  opacity: 0;
  transform: translate3d(0, 12px, 0) scale(0.982);
  animation: card-rise 760ms cubic-bezier(0.2, 1.25, 0.32, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

/* Entrance delay per element — centralized here instead of inline in HTML */
.stage .profile { --delay: 110ms; }
.stage .photo-strip { --delay: 40ms; }
.stage .write-pill { --delay: 100ms; }
.stage .hero { --delay: 180ms; }
.stage .latest { --delay: 250ms; }
.stage .social-strip { --delay: 350ms; }
.stage .clock-card { --delay: 380ms; }
.stage .calendar-card { --delay: 420ms; }
.stage .project-peek { --delay: 450ms; }

.nav-motion-active .rise {
  animation: none;
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.986);
}

.nav-motion-active.nav-motion-revealed .rise {
  animation: card-rise var(--anim-rise-nav) cubic-bezier(0.2, 1.2, 0.32, 1) forwards;
  animation-delay: calc(70ms + var(--delay, 0ms) * 0.45);
}

.nav-motion-active.nav-motion-revealed .site-rail .nav a {
  animation-delay: calc(30ms + var(--item, 0) * 46ms);
}

.site-rail {
  position: fixed;
  z-index: 1000;
  margin: 0;
  transform: translate3d(0, 0, 0);
  transform-origin: top left;
  contain: layout paint;
}

.site-rail.is-morphing {
  transform-origin: top left;
  pointer-events: none;
}

.site-rail.is-morphing .profile-head,
.site-rail.is-morphing .profile-copy,
.site-rail.is-morphing .nav {
  animation: rail-detail-settle var(--anim-detail-settle) cubic-bezier(0.16, 1, 0.28, 1) both;
}

.site-rail.is-morphing .profile-copy { animation-delay: 60ms; }
.site-rail.is-morphing .nav { animation-delay: 95ms; }

.rail-ready:not(.rail-entered):not(.nav-motion-active) .site-rail {
  animation: rail-enter 760ms cubic-bezier(0.2, 1.25, 0.32, 1) both;
}

html.rail-ready main .profile {
  visibility: hidden;
  pointer-events: none;
}

.home {
  height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--stage-max-w);
  height: var(--stage-max-h);
  transform: translate(calc(-50% + var(--pan-x, 0px)), calc(-50% + var(--pan-y, 0px)));
  --hero-top: 226px;
  --hero-height: 252px;
  --project-bottom: 58px;
  --project-height: 144px;
  --social-height: 44px;
  --range-top: calc(100% - var(--hero-top) - var(--hero-height));
  --range-bottom: calc(var(--project-bottom) + var(--project-height));
  --center-gap-bottom: calc((var(--range-top) + var(--range-bottom) - var(--social-height)) / 2);
  isolation: isolate;
}

.ambient {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
}

.ambient-a {
  left: 30px;
  top: 20px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 30% 40%, rgba(235, 140, 160, 0.25) 0%, rgba(235, 140, 160, 0.08) 35%, transparent 60%);
  filter: blur(70px);
  animation: ambient-float-a 14s ease-in-out infinite alternate;
}

.ambient-b {
  right: 40px;
  bottom: 20px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle at 70% 60%, rgba(55, 199, 182, 0.18) 0%, rgba(32, 169, 157, 0.06) 40%, transparent 65%);
  filter: blur(80px);
  animation: ambient-float-b 18s ease-in-out infinite alternate;
}

.ambient-c {
  left: 50%;
  top: 30%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(244, 211, 111, 0.12) 0%, transparent 55%);
  filter: blur(60px);
  animation: ambient-float-c 12s ease-in-out infinite alternate;
}

@keyframes ambient-float-a {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.08); }
}

@keyframes ambient-float-b {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-50px, 40px) scale(1.06); }
}

@keyframes ambient-float-c {
  0% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50% { opacity: 0.6; }
  100% { transform: translate(30px, 30px) scale(1.1); opacity: 0.4; }
}

.photo-strip {
  position: absolute;
  left: 490px;
  top: 34px;
  width: 410px;
  height: 150px;
  transform: none;
  overflow: hidden;
  border-radius: 40px;
}

.photo {
  position: absolute;
  width: 126px;
  height: 98px;
  border: 5px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  background:
    radial-gradient(circle at 31% 34%, #fff7d5 0 13%, transparent 14%),
    linear-gradient(135deg, #f7d9cf 0%, #d4f2eb 100%);
  box-shadow: 0 16px 32px rgba(35, 69, 73, 0.08);
  animation: drift 6.2s var(--ease) infinite alternate;
}

.photo i {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 40px;
  height: 20px;
  border-radius: 999px 999px 8px 8px;
  background: rgba(55, 199, 182, 0.72);
}

.photo-one { left: 76px; top: 27px; rotate: -7deg; }
.photo-two { left: 162px; top: 16px; rotate: 4deg; animation-delay: -2s; }
.photo-three { left: 242px; top: 31px; rotate: -3deg; animation-delay: -4s; }

.profile {
  position: absolute;
  left: var(--profile-left);
  top: var(--profile-top);
  width: 338px;
  height: 432px;
  padding: 31px 32px;
  border-radius: 42px;
  transform: none;
}

.site-rail.is-home {
  left: calc(50% + var(--pan-x, 0px) - (var(--stage-max-w) / 2) + var(--profile-left));
  top: calc(50% + var(--pan-y, 0px) - (var(--stage-max-h) / 2) + var(--profile-top));
  width: 338px;
  height: 432px;
  padding: 31px 32px;
  border-radius: 42px;
  display: block;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 15px;
}

.avatar, .hero-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--ink-strong);
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.95) 0 16%, transparent 17%),
    linear-gradient(145deg, #fff0a4, #d7f0e8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  font-weight: 700;
}

.avatar {
  width: 56px;
  height: 56px;
  font-size: 25px;
}

.eyebrow, .label {
  margin: 0;
  color: var(--aqua-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile h1 {
  margin: 4px 0 0;
  color: var(--ink-strong);
  font-size: 32px;
  line-height: 1.05;
  font-weight: 720;
}

.profile-copy {
  display: -webkit-box;
  overflow: hidden;
  margin: 22px 0 24px;
  color: rgba(47, 73, 76, 0.78);
  font-size: 15px;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  transition: transform 280ms var(--ease), color 280ms var(--ease), background 280ms var(--ease);
}

.nav-motion-active .nav a {
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(0.98);
}

.nav-motion-active.nav-motion-revealed .nav a {
  animation: nav-item-rise 520ms cubic-bezier(0.2, 1.25, 0.32, 1) forwards;
}

.nav a:hover, .nav a:focus-visible, .nav a[aria-current="page"] {
  color: var(--ink-strong);
  background: var(--surface-md);
  outline: none;
  transform: translateX(3px);
}

.hero {
  position: absolute;
  left: 530px;
  top: var(--hero-top);
  width: 330px;
  height: var(--hero-height);
  padding: 24px 28px 26px;
  border-radius: 38px;
  text-align: center;
  transition: transform 300ms var(--ease), background 300ms var(--ease), box-shadow 300ms var(--ease);
}

.hero:hover {
  background: var(--surface-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.hero-avatar {
  width: 54px;
  height: 54px;
  margin: 0 auto 13px;
  font-size: 25px;
  animation: breathe 4.8s ease-in-out infinite;
}

.greeting {
  margin: 0 0 6px;
  color: var(--aqua-deep);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 31px;
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.hero-copy {
  display: -webkit-box;
  overflow: hidden;
  max-width: 252px;
  margin: 11px auto 0;
  color: var(--text-subtle);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.latest {
  position: absolute;
  left: var(--profile-left);
  bottom: 58px;
  width: 330px;
  min-height: 126px;
  padding: 21px 25px;
  border-radius: 36px;
  transition: transform 300ms var(--ease), background 300ms var(--ease), box-shadow 300ms var(--ease);
}

.latest strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--ink-strong);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 720;
}

.latest small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 560;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.latest:hover, .latest:focus-visible {
  outline: none;
  background: var(--surface-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.social-strip {
  position: absolute;
  left: 540px;
  bottom: var(--center-gap-bottom);
  min-height: var(--social-height);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
}

.linklike {
  background: none;
  border: none;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.social-strip a,
.social-strip button {
  min-width: 64px;
  height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.54);
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 760;
  transition: transform 260ms var(--ease), background 260ms var(--ease);
}

.social-strip a:first-child,
.social-strip button:first-child {
  min-width: 88px;
  background: rgba(23,48,51,.92);
  color: #fff;
}

.social-strip a:hover,
.social-strip a:focus-visible,
.social-strip button:hover,
.social-strip button:focus-visible {
  outline: none;
  transform: translateY(-2px);
  background: rgba(255,255,255,.68);
}

.social-strip a:first-child:hover,
.social-strip a:first-child:focus-visible,
.social-strip button:first-child:hover,
.social-strip button:first-child:focus-visible {
  background: rgba(23,48,51,.84);
}

.clock-card {
  position: absolute;
  right: 150px;
  top: 174px;
  width: 278px;
  min-height: 156px;
  padding: 28px 24px;
  border-radius: 34px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  transition: transform 300ms var(--ease), background 300ms var(--ease), box-shadow 300ms var(--ease);
}

.clock-card strong {
  display: block;
  color: var(--ink-strong);
  font-size: 80px;
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.clock-card:hover {
  background: var(--surface-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.clock-card .label {
  margin: 0;
  color: var(--text-muted);
}

.calendar-card {
  position: absolute;
  right: 66px;
  top: 382px;
  width: 430px;
  min-height: 330px;
  padding: 28px 28px 26px;
  border-radius: 42px;
  transition: transform 300ms var(--ease), background 300ms var(--ease), box-shadow 300ms var(--ease);
}

.calendar-card:hover {
  background: var(--surface-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.calendar-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin: 24px 0 16px;
  color: rgba(47,73,76,.56);
  font-size: 13px;
}

.calendar-head span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.calendar-grid em,
.calendar-grid i {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 13px;
  font-style: normal;
  color: rgba(47,73,76,.66);
  font-size: 14px;
}

.calendar-grid em.is-today {
  background: rgba(55,199,182,.18);
  color: var(--aqua-deep);
  font-weight: 760;
}

.calendar-grid i {
  opacity: 0;
}

.write-pill {
  position: absolute;
  right: 180px;
  top: 96px;
  min-width: 132px;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(55,199,182,.86), rgba(32,169,157,.78));
  color: #fff;
  font-size: 16px;
  font-weight: 780;
  box-shadow: 0 18px 42px rgba(32,169,157,.24), inset 0 1px 0 var(--surface-md);
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}

.write-pill:hover,
.write-pill:focus-visible {
  outline: none;
  transform: translateY(-3px);
  box-shadow: 0 24px 58px rgba(32,169,157,.32), inset 0 1px 0 var(--surface-hover);
}

.project-peek {
  position: absolute;
  left: 520px;
  bottom: var(--project-bottom);
  width: 380px;
  height: var(--project-height);
  padding: 23px 28px;
  border-radius: 36px;
  transition: transform 300ms var(--ease), background 300ms var(--ease), box-shadow 300ms var(--ease);
}

.project-peek strong {
  display: block;
  margin: 7px 0 7px;
  color: var(--ink-strong);
  font-size: 22px;
  line-height: 1.18;
}

.project-peek small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-peek:hover,
.project-peek:focus-visible {
  outline: none;
  transform: translateY(-3px);
  background: var(--surface-hover);
  box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.inner-shell {
  position: relative;
  width: min(1180px, calc(100vw - 48px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 28px 0 76px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  align-items: start;
}

.inner-shell .profile {
  position: sticky;
  top: 24px;
  right: auto;
  z-index: 20;
  width: fit-content;
  max-width: 100%;
  height: 64px;
  min-height: 0;
  padding: 8px 10px 8px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transform: none;
}

.site-rail.is-compact {
  left: calc((100vw - min(1180px, calc(100vw - 48px))) / 2);
  top: 28px;
  width: fit-content;
  max-width: calc(100vw - 48px);
  height: 64px;
  min-height: 0;
  padding: 8px 10px 8px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.site-rail.is-compact .profile-head,
.inner-shell .profile-head {
  gap: 10px;
}

.site-rail.is-compact .avatar,
.inner-shell .avatar {
  width: 40px;
  height: 40px;
  font-size: 19px;
}

.site-rail.is-compact h1,
.inner-shell .profile h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-rail.is-compact .profile-copy,
.inner-shell .profile-copy {
  display: none;
}

.site-rail.is-compact .nav,
.inner-shell .nav {
  display: flex;
  gap: 4px;
}

.site-rail.is-compact .nav a,
.inner-shell .nav a {
  min-height: 40px;
  padding: 0 14px;
  font-size: 13px;
}

.site-rail.is-compact .nav a:hover,
.site-rail.is-compact .nav a:focus-visible,
.site-rail.is-compact .nav a[aria-current="page"],
.inner-shell .nav a:hover,
.inner-shell .nav a:focus-visible,
.inner-shell .nav a[aria-current="page"] {
  transform: translateY(-1px);
}

.panel {
  width: min(920px, 100%);
  margin: 0 auto;
  min-height: 520px;
  padding: clamp(28px, 5vw, 54px);
  border-radius: 46px;
}

.projects-page .panel {
  width: min(920px, 100%);
}

.panel h1, .article h1 {
  margin: 8px 0 14px;
  color: var(--ink-strong);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.98;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.lead {
  max-width: 560px;
  margin: 0 0 34px;
  color: rgba(47, 73, 76, 0.7);
  font-size: 17px;
  line-height: 1.8;
}

.archive {
  display: grid;
  gap: 18px;
}

.year-group {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.year-group h2 {
  position: sticky;
  top: 86px;
  margin: 12px 0 0;
  color: rgba(23, 48, 51, 0.48);
  font-size: 20px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.list {
  display: grid;
  gap: 14px;
}


/* Timeline layout for article list */
.tl-entry {
  display: grid;
  grid-template-columns: 44px 2px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: start;
}

.tl-date {
  grid-column: 1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-align: right;
  padding-top: 22px;
  white-space: nowrap;
}

.tl-body {
  grid-column: 3;
  min-width: 0;
}

/* Timeline vertical line */
.tl-entry::before {
  content: '';
  display: block;
  width: 2px;
  height: calc(100% + 10px);
  background: linear-gradient(to bottom, var(--aqua), rgba(55, 199, 182, 0.08));
  border-radius: 1px;
  grid-column: 2;
  grid-row: 1;
}

.tl-entry:first-child::before {
  height: 100%;
}

.tl-entry:last-child::before {
  display: none;
}

/* Timeline dot */
.tl-entry::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--aqua);
  box-shadow: 0 0 0 2px var(--mist-strong);
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  margin-top: 25px;
  z-index: 1;
}


.list-item, .project-card {
  display: block;
  padding: 22px 24px;
  border-radius: 30px;
  background: var(--surface-sm);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: transform 260ms var(--ease), background 260ms var(--ease);
}

.list-item:hover, .list-item:focus-visible, .project-card:hover {
  outline: none;
  background: rgba(255, 255, 255, 0.56);
  transform: translateY(-3px);
}

.list-item span, .project-card span {
  color: var(--aqua-deep);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.list-item strong, .project-card h2 {
  display: block;
  margin: 0 0 6px;
  color: var(--ink-strong);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 740;
}

.list-item p, .project-card p, .about-copy p {
  margin: 0;
  color: var(--text-subtle);
  font-size: 15px;
  line-height: 1.75;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tags em {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--mist);
  color: rgba(47, 73, 76, 0.66);
  font-size: 12px;
  font-style: normal;
  font-weight: 720;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-card:last-child {
  grid-column: 1 / -1;
}


.project-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-feature {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
  min-height: 220px;
  padding: 26px;
  overflow: hidden;
  border-radius: 34px;
  background: var(--surface-sm);
  border: 1px solid rgba(255, 255, 255, 0.42);
  transition: transform 280ms var(--ease), background 280ms var(--ease), box-shadow 280ms var(--ease);
}

.project-feature::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -48px;
  width: 138px;
  height: 138px;
  border-radius: 999px;
  background: rgba(55, 199, 182, 0.12);
  pointer-events: none;
}

.project-feature.is-primary {
  min-height: 230px;
  background: var(--surface-md);
  grid-column: 1 / -1;
}

.project-feature:hover {
  transform: translateY(-3px);
  background: var(--surface-hover);
  box-shadow: 0 30px 80px rgba(35, 69, 73, 0.12);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-meta span {
  width: fit-content;
  min-height: 28px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  color: rgba(47, 73, 76, 0.64);
  font-size: 12px;
  font-weight: 760;
}

.project-role {
  margin: 0 0 8px;
  color: var(--aqua-deep);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.project-body h2 {
  margin: 0 0 10px;
  color: var(--ink-strong);
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.project-body p:not(.project-role) {
  max-width: 560px;
  margin: 0;
  color: rgba(47, 73, 76, 0.7);
  font-size: 15px;
  line-height: 1.75;
}

.project-links {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.project-links a {
  min-width: 74px;
  height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(23, 48, 51, 0.88);
  color: #f7faf6;
  font-size: 13px;
  font-weight: 760;
  transition: transform 240ms var(--ease), background 240ms var(--ease);
}

.project-links a:hover,
.project-links a:focus-visible {
  outline: none;
  transform: translateY(-2px);
  background: var(--aqua-deep);
}

.about-copy {
  display: grid;
  gap: 16px;
  max-width: 620px;
}

.about-copy a,
.about-copy button {
  color: var(--aqua-deep);
  font-weight: 700;
}

.back-link {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.34);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
}

.article {
  padding: clamp(30px, 6vw, 64px);
  border-radius: 46px;
}

.article-head {
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.article-tags {
  margin-top: -12px;
  margin-bottom: 4px;
}

.prose {
  margin-top: 34px;
  color: rgba(23, 48, 51, 0.84);
  font-size: 17px;
  line-height: 1.95;
}

.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre {
  margin: 0 0 1.25em;
}

.prose h2, .prose h3 {
  margin: 2em 0 0.8em;
  color: var(--ink-strong);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.prose h2 { font-size: 28px; }
.prose h3 { font-size: 22px; }

.prose a {
  color: var(--aqua-deep);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.prose blockquote {
  padding: 4px 0 4px 22px;
  border-left: 3px solid rgba(32, 169, 157, 0.42);
  color: rgba(47, 73, 76, 0.7);
}

.prose code {
  padding: 0.12em 0.36em;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.9em;
}

.prose pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(23, 48, 51, 0.86);
  color: #f4f8f4;
}

.prose pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 44px;
}

.post-nav a {
  min-height: 108px;
  padding: 20px 22px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.38);
  transition: transform 260ms var(--ease), background 260ms var(--ease);
}

.post-nav a:hover, .post-nav a:focus-visible {
  outline: none;
  background: var(--surface-hover);
  transform: translateY(-3px);
}

.post-nav span {
  display: block;
  margin-bottom: 8px;
  color: var(--aqua-deep);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-nav strong {
  color: var(--ink-strong);
  font-size: 17px;
  line-height: 1.35;
}

.post-nav .muted-link {
  opacity: 0.6;
}

@keyframes card-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 13px, 0) scale(0.982);
  }
  62% {
    opacity: 1;
    transform: translate3d(0, -3px, 0) scale(1.006);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes nav-item-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.98);
  }
  70% {
    opacity: 1;
    transform: translate3d(0, -2px, 0) scale(1.012);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes rail-enter {
  0% {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.982);
  }
  64% {
    opacity: 1;
    transform: translate3d(0, -3px, 0) scale(1.006);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes rail-detail-settle {
  0% {
    opacity: 0.18;
    transform: translate3d(0, 7px, 0) scale(0.985);
    filter: blur(2px);
  }
  58% {
    opacity: 1;
    transform: translate3d(0, -1px, 0) scale(1.004);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

@keyframes drift {
  to { translate: 0 -4px; }
}

@media (max-width: 820px) {
  .inner-shell {
    width: min(560px, calc(100vw - 36px));
    min-height: auto;
    padding: 28px 0;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .inner-shell .profile {
    position: static;
    width: 100%;
    height: auto;
    min-height: auto;
    border-radius: 34px;
    display: grid;
    gap: 14px;
    padding: 22px 24px;
  }

  .site-rail.is-compact {
    left: 18px;
    top: 18px;
    width: calc(100vw - 36px);
    height: auto;
    min-height: auto;
    border-radius: 34px;
    display: grid;
    gap: 14px;
    padding: 22px 24px;
  }

  .site-rail.is-compact .profile-copy {
    display: -webkit-box;
  }

  .site-rail.is-compact .nav {
    display: grid;
    gap: 6px;
  }

  .site-rail.is-compact .nav a {
    min-height: 42px;
  }

  .inner-shell .profile-copy {
    display: -webkit-box;
  }

  .inner-shell .nav {
    display: grid;
    gap: 6px;
  }

  .inner-shell .nav a {
    min-height: 42px;
  }

  .panel {
    min-height: auto;
    border-radius: 38px;
  }

  .project-grid,
  .project-stack,
  .post-nav {
    grid-template-columns: 1fr;
  }

  .project-feature {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .project-links {
    justify-content: flex-start;
  }

  .tl-entry {
    grid-template-columns: 36px 2px minmax(0, 1fr);
    gap: 8px 10px;
  }
  .tl-date {
    font-size: 10px;
    padding-top: 18px;
  }
  .tl-entry::after {
    margin-top: 21px;
  }
  .year-group {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .year-group h2 {
    position: static;
    margin: 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;
  }
}

.site-beian {
  position: relative;
  z-index: 1200;
  display: flex;
  justify-content: center;
  padding: 18px 24px 24px;
  color: rgba(47, 73, 76, 0.56);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.site-beian a {
  transition: color 220ms var(--ease);
}

.site-beian a:hover,
.site-beian a:focus-visible {
  color: var(--aqua-deep);
}

.home-page .site-beian {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  pointer-events: none;
}

.home-page .site-beian a {
  pointer-events: auto;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  padding: 10px 20px;
  border-radius: 12px;
  background: rgba(23, 48, 51, 0.88);
  color: #f4f8f4;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: opacity 280ms var(--ease), transform 280ms var(--ease);
  pointer-events: none;
  z-index: 9999;
}

.toast.hidden {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.5);
  color: var(--ink-strong);
  font-weight: 700;
  text-decoration: none;
  transition: background 260ms var(--ease), transform 260ms var(--ease);
}

.tag-chip small {
  color: var(--muted);
  font-weight: 600;
}

.tag-chip:hover {
  background: rgba(255,255,255,.72);
  transform: translateY(-2px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: rgba(244, 250, 249, 0.97);
    --ink-strong: #ffffff;
    --muted: rgba(222, 236, 234, 0.8);
    --mist: rgba(15, 33, 37, 0.55);
    --mist-strong: rgba(18, 40, 44, 0.72);
    --line: rgba(255, 255, 255, 0.15);
    --aqua: #4ad9c6;
    --aqua-deep: #3bcfba;
    --sun: #f2d47a;
    --text-faint: rgba(255, 255, 255, 0.62);
    --text-muted: rgba(255, 255, 255, 0.74);
    --text-subtle: rgba(255, 255, 255, 0.82);
    --text-soft: rgba(255, 255, 255, 0.88);
    --text-body: rgba(255, 255, 255, 0.96);
    --surface-sm: rgba(255, 255, 255, 0.05);
    --surface-md: rgba(255, 255, 255, 0.08);
    --surface-hover: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 24px 70px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 30px 80px rgba(0, 0, 0, 0.5);
    --border-strong: rgba(255, 255, 255, 0.16);
  }
  html { background: #0d1b1e; }
  body {
    background:
      radial-gradient(circle at 19% 78%, rgba(234, 200, 109, 0.16), transparent 29%),
      radial-gradient(circle at 78% 76%, rgba(55, 199, 182, 0.12), transparent 31%),
      radial-gradient(circle at 66% 17%, rgba(62, 208, 189, 0.08), transparent 25%),
      linear-gradient(145deg, #101d20 0%, #0d1b1e 48%, #0b1a1c 100%);
  }
  body::before {
    background-image:
      radial-gradient(circle, rgba(230, 243, 241, 0.5) 0 0.7px, transparent 0.8px),
      radial-gradient(circle, rgba(230, 243, 241, 0.22) 0 0.6px, transparent 0.7px);
    mix-blend-mode: screen;
  }
  .glass {
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
  .glass::after {
    background: linear-gradient(145deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.02) 35%,
      rgba(255, 255, 255, 0.05) 100%);
  }
  /* 硬编码白色玻璃 -> 暗色玻璃 */
  .social-strip button,
  .social-strip button:focus-visible { background: rgba(255,255,255,.08); }
  .list-item:hover, .list-item:focus-visible, .project-card:hover { background: rgba(255,255,255,.08); }
  .project-meta span { background: rgba(255,255,255,.08); }
  .back-link { background: rgba(255,255,255,.07); }
  .prose code { background: rgba(255,255,255,.09); }
  .post-nav a { background: rgba(255,255,255,.07); }
  .tag-chip { background: rgba(255,255,255,.08); }
  .tag-chip:hover { background: rgba(255,255,255,.12); }
  .year-group h2 { color: rgba(255,255,255,.66); }
  .prose { color: var(--text-body); }
  /* 写死的浅色主题深色文字 -> 深色模式用亮色变量 */
  .profile-copy, .lead { color: var(--text-soft); }
  .prose blockquote { color: var(--text-soft); }
  .tags em, .project-meta span, .site-beian { color: var(--text-muted); }
  .project-body p:not(.project-role) { color: var(--text-body); }
  .calendar-head, .calendar-grid em, .calendar-grid i { color: var(--text-subtle); }
  /* 已是深色的元素（social 主按钮、project-links、pre、toast）无需改动 */
}

@media (max-width: 820px) {
  body.home-page {
    overflow-y: auto;
  }
  .home {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }
  .stage {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: auto;
    min-height: 100svh;
    transform: none;
    padding: 20px 16px 48px;
    display: grid;
    gap: 14px;
    align-content: start;
  }
  .stage .ambient,
  .stage .photo-strip {
    display: none;
  }
  .stage .profile,
  .stage .hero,
  .stage .latest,
  .stage .project-peek,
  .stage .clock-card,
  .stage .calendar-card {
    position: static;
    width: 100%;
    height: auto;
    min-height: auto;
  }
  .stage .profile {
    border-radius: 36px;
    padding: 22px 20px;
  }
  .stage .hero {
    border-radius: 36px;
    padding: 26px 20px;
  }
  .stage .hero-copy {
    max-width: none;
  }
  .stage .latest,
  .stage .project-peek {
    border-radius: 36px;
    padding: 20px;
  }
  .stage .clock-card {
    border-radius: 36px;
    padding: 24px 20px;
  }
  .stage .calendar-card {
    border-radius: 36px;
    padding: 22px 20px;
  }
  .stage .social-strip {
    position: static;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .stage .write-pill {
    position: static;
    width: 100%;
    min-height: 52px;
    border-radius: 36px;
  }
  .stage .nav {
    display: grid;
    gap: 6px;
  }
  .stage .nav a {
    min-height: 42px;
  }
}

/* Admin page — login, frame, navigation */
.admin-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.admin-page::after {
  content: "";
  position: fixed;
  right: 8vw;
  top: 10vh;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(55, 199, 182, .1);
  filter: blur(2px);
  pointer-events: none;
}

/* Login */
.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-login section {
  width: min(460px, calc(100vw - 40px));
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 36px;
  background: var(--mist-strong);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.admin-login h1 {
  margin: 4px 0 8px;
  color: var(--ink-strong);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -.04em;
}

.admin-login form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.admin-login label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 760;
}

.admin-login input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, .62);
  padding: 12px 13px;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 220ms var(--ease), background 220ms var(--ease), box-shadow 220ms var(--ease);
}

.admin-login input:focus {
  border-color: rgba(32, 169, 157, .5);
  box-shadow: 0 0 0 4px rgba(32, 169, 157, .1);
}

.admin-login button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--ink-strong);
  color: #fff;
  padding: 0 17px;
  font-weight: 780;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
}

/* Admin frame layout */
.admin-frame {
  min-height: 100svh;
  padding: clamp(18px, 3.3vw, 40px);
  display: grid;
  place-items: center;
}

.admin-work-grid {
  width: min(1180px, calc(100vw - 48px));
  min-height: calc(100svh - 80px);
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.admin-rail-card {
  padding: 27px 28px 28px;
  border-radius: 42px;
}

.admin-work-grid .admin-rail-card {
  position: sticky;
  top: 40px;
  min-height: calc(100svh - 80px);
}

.admin-nav a[aria-current="page"] {
  color: var(--ink-strong);
  background: var(--surface-md);
  transform: translateX(3px);
}

.admin-logout {
  margin: 0;
}

.admin-logout button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: color 280ms var(--ease), background 280ms var(--ease);
}

.admin-logout button:hover,
.admin-logout button:focus-visible {
  outline: none;
  color: var(--ink-strong);
  background: var(--surface-md);
}

.admin-notice {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

/* Page header */
.admin-head {
  min-height: 204px;
  padding: 34px 38px;
  border-radius: 42px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.admin-head h1 {
  margin: 6px 0 12px;
  color: var(--ink-strong);
  font-size: clamp(42px, 6vw, 72px);
  line-height: .95;
  letter-spacing: -.045em;
}

.admin-head p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  color: var(--text-subtle);
  font-size: 16px;
  line-height: 1.75;
}

.admin-work-area {
  display: grid;
  gap: 16px;
}

/* Shared button / link styles */
.admin-link,
.admin-card button,
.mini {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--ink-strong);
  color: #fff;
  padding: 0 17px;
  font-weight: 780;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
}

.mini {
  min-height: 34px;
  min-width: 54px;
  background: var(--mist-strong);
  color: var(--ink-strong);
  border: 1px solid var(--line);
}

.mini.danger {
  color: #8f2020;
  background: rgba(210, 66, 66, .1);
}

/* Manage layout: summary + list */
.admin-manage-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-summary-card {
  position: sticky;
  top: 40px;
  min-height: 238px;
  padding: 25px;
  border-radius: 36px;
  display: grid;
  align-content: end;
  gap: 12px;
}

.admin-summary-card strong {
  display: block;
  color: var(--ink-strong);
  font-size: 54px;
  line-height: .9;
  letter-spacing: -.05em;
}

.admin-summary-card span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 760;
}

.admin-list-panel {
  padding: 22px;
  border-radius: 36px;
}

/* Section header */
.section-head,
.row-title,
.row-actions,
.form-actions {
  display: flex;
  align-items: center;
}

.section-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 4px 0 0;
  color: var(--ink-strong);
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: -.03em;
}

/* Content rows */
.content-list {
  display: grid;
  gap: 11px;
}

.content-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  min-width: 0;
  padding: 13px 14px;
  border-radius: 24px;
  background: var(--surface-sm);
  border: 1px solid rgba(255, 255, 255, .48);
}

.content-row > div:first-child {
  min-width: 0;
}

.content-row strong {
  color: var(--ink-strong);
  font-size: 15px;
}

.content-row p {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.row-title {
  gap: 9px;
  min-width: 0;
}

.row-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.row-actions form {
  margin: 0;
}

/* Status badges */
.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
  flex-shrink: 0;
}

.status.live {
  color: #16776f;
  background: rgba(32, 169, 157, .13);
}

.status.draft {
  color: #8f6420;
  background: rgba(244, 211, 111, .22);
}

/* Empty state */
.empty {
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .32);
  color: var(--muted);
  font-weight: 700;
}

/* Cards (form wrapper) */
.admin-card {
  display: grid;
  gap: 14px;
  padding: 26px;
  border-radius: 36px;
  border: 1px solid var(--line);
  background: var(--mist);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--mist-strong);
  backdrop-filter: blur(18px) saturate(1.08);
}

.admin-form {
  width: min(820px, 100%);
}

.admin-card label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 760;
}

.admin-card input,
.admin-card textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, .62);
  padding: 12px 13px;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 220ms var(--ease), background 220ms var(--ease), box-shadow 220ms var(--ease);
}

.admin-card input:focus,
.admin-card textarea:focus {
  border-color: rgba(32, 169, 157, .5);
  box-shadow: 0 0 0 4px rgba(32, 169, 157, .1);
}

.admin-card textarea {
  min-height: 92px;
  resize: vertical;
}

.admin-card .tall {
  min-height: 300px;
}

/* Two-column grid for form fields */
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Checkbox row */
.admin-card .check {
  display: flex;
  align-items: center;
  align-self: end;
  min-height: 44px;
}

.check input {
  width: auto;
}

.form-actions {
  gap: 10px;
  flex-wrap: wrap;
}

/* Flash messages */
.message,
.error {
  padding: 12px 14px;
  border-radius: 18px;
}

.message {
  background: rgba(32, 169, 157, .13);
  color: #16776f;
}

.error {
  background: rgba(210, 66, 66, .12);
  color: #8f2020;
}

/* AI review queue */
.automation-toolbar {
  padding: 4px 2px;
  color: var(--text-muted);
}

.automation-toolbar strong {
  color: var(--ink-strong);
  font-size: 32px;
}

.automation-list {
  display: grid;
  gap: 14px;
}

.automation-draft {
  width: min(820px, 100%);
}

.automation-draft-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.automation-draft h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 20px;
  line-height: 1.25;
}

.automation-summary,
.automation-project p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.automation-project {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.automation-project strong {
  color: var(--ink-strong);
}

/* Responsive */
@media (max-width: 1080px), (max-height: 680px) {
  .admin-frame {
    place-items: start center;
    padding: 18px;
  }

  .admin-work-grid {
    width: min(560px, 100%);
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 720px) {
  .admin-frame {
    padding: 14px;
  }

  .admin-work-grid {
    width: 100%;
  }

  .two {
    grid-template-columns: 1fr;
  }

  .content-row {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .automation-draft-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-head h1 {
    font-size: clamp(38px, 14vw, 56px);
  }
}

/* Editor tabs */
.editor-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.editor-tab {
  min-height: 0 !important;
  border: 0 !important;
  padding: 8px 16px;
  background: transparent !important;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  color: rgba(47, 73, 76, 0.6);
  transition: color 200ms, background 200ms;
}

.editor-tab.active {
  color: var(--ink-strong);
  background: rgba(255, 255, 255, 0.4) !important;
}

.editor-pane {
  border-radius: 0 0 16px 16px !important;
}

.editor-preview {
  overflow-y: auto;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
}

.editor-preview p { margin: 0 0 0.8em; }
.editor-preview code {
  padding: 0.12em 0.36em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.9em;
}
.editor-preview strong { color: var(--ink-strong); }
.editor-preview a { color: var(--aqua-deep); font-weight: 700; }

.status.devlog {
  color: #4b5fa8;
  background: rgba(99, 124, 214, .16);
}

@media (prefers-color-scheme: dark) {
  .admin-login input, .admin-card textarea { background: rgba(255,255,255,.08); color: var(--ink-strong); }
  .empty { background: rgba(255,255,255,.06); }
  .editor-tab.active { background: rgba(255,255,255,.1) !important; }
  .editor-preview { background: rgba(255,255,255,.08); }
  .editor-preview code { background: rgba(255,255,255,.1); }
}
