@font-face {
  font-family: 'Geist Pixel Square';
  src: url('/assets/fonts/GeistPixel-Square.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c0c0c;
  --text: #e0e0e0;
  --text-bright: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.45);
  --text-faint: rgba(255, 255, 255, 0.2);
  --purple: #8040FC;
  --link: #e0e0e0;
  --link-hover: #ffffff;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Subtle center glow */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.025) 0%, transparent 70%);
}

/* ---- Tree mark with liquid glass ---- */

.mark {
  padding: 2.5rem 0 0;
  padding-left: max(2rem, env(safe-area-inset-left));
}

.mark a {
  color: var(--text-bright);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;

  /* Liquid glass material */
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.25s ease;
}

/* Static specular highlight (top edge) */
.mark a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  z-index: 2;
}

/* Cursor-tracking specular glow */
.mark a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    circle 40px at var(--gx, 50%) var(--gy, 50%),
    rgba(255, 255, 255, calc(0.25 * var(--gi, 0))),
    transparent 70%
  );
  opacity: var(--gi, 0);
  transition: opacity 0.15s ease;
}

.mark a:hover {
  background: rgba(255, 255, 255, 0.09);
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.mark svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.08));
}

/* ---- Main content ---- */

main {
  max-width: 600px;
  padding: 3rem 2rem 5rem;
  padding-left: max(2rem, env(safe-area-inset-left));
  padding-right: max(2rem, env(safe-area-inset-right));
  padding-bottom: max(5rem, calc(2rem + env(safe-area-inset-bottom)));
  position: relative;
  z-index: 10;
}

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

section {
  margin-bottom: 2.5rem;
}

.intro {
  margin-bottom: 3.5rem;
}

.intro h1 {
  font-family: 'Geist Pixel Square', monospace;
  font-size: 1.5rem;
  font-weight: normal;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
}

.intro p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-dim);
  max-width: 480px;
}

h2 {
  font-family: 'Geist Pixel Square', monospace;
  font-size: 0.95rem;
  font-weight: normal;
  color: var(--text-bright);
  margin-bottom: 0.35rem;
}

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

h2 a::after {
  content: ' \2192';
  color: var(--text-faint);
  transition: color 0.15s;
}

h2 a:hover {
  color: var(--link-hover);
}

h2 a:hover::after {
  color: var(--text-bright);
}

.dim {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ---- Links ---- */

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

/* No underline on structural nav */
.mark a,
.back {
  text-decoration: none;
}

/* ---- Link lists ---- */

.link-list {
  list-style: none;
}

.link-list li {
  margin-bottom: 0.35rem;
}

.link-list a {
  font-size: 0.9rem;
}

/* ---- Muted text ---- */

.muted {
  font-size: 0.85rem;
  color: var(--text-faint);
  font-style: italic;
}

/* ---- Quotes page ---- */

.quote-list {
  list-style: none;
}

.quote-list li {
  margin-bottom: 1.75rem;
}

.quote-list blockquote {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  font-style: normal;
  margin: 0;
}

.quote-list cite {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: normal;
  margin-top: 0.3rem;
}

.quote-list .separator {
  margin: 2.5rem 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.quote-section-label {
  font-family: 'Geist Pixel Square', monospace;
  font-size: 0.8rem;
  font-weight: normal;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

/* ---- Random quote on home ---- */

.random-quote {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.5rem;
  border: none;
  padding: 0;
}

.random-quote cite {
  display: block;
  font-size: 0.8rem;
  color: var(--text-faint);
  font-style: normal;
  margin-top: 0.25rem;
}

/* ---- Back link ---- */

.back {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.back:hover {
  color: var(--text-bright);
}

/* ---- Writing list ---- */

.writing-list {
  list-style: none;
}

.writing-list li {
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* Writing card with image */
.writing-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  text-decoration: none;
  border-radius: 10px;
  padding: 0.5rem;
  margin: -0.5rem;
  transition: background 0.2s;
}

.writing-card:hover {
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.writing-thumb {
  width: 140px;
  height: auto;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: cover;
}

.writing-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0.15rem;
}

.writing-title {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
}

.writing-card:hover .writing-title {
  color: var(--text-bright);
}

.writing-list a {
  font-size: 0.95rem;
  font-weight: 400;
}

.writing-date {
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ---- Essay ---- */

.essay-header {
  margin-bottom: 2.5rem;
}

.essay-img {
  width: 100%;
  max-width: 540px;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: block;
}

.essay-header h1 {
  font-family: 'Geist Pixel Square', monospace;
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  font-weight: normal;
  color: var(--text-bright);
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.essay-header time {
  font-size: 0.8rem;
  color: var(--text-faint);
}

.essay p {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 1.25rem;
  max-width: 540px;
}

.essay h2 {
  font-size: 1rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-bright);
}

.essay blockquote {
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-dim);
  max-width: 500px;
}

.essay strong {
  font-weight: 500;
  color: var(--text-bright);
}

.essay-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.essay-footer p {
  font-size: 0.8rem;
  color: var(--text-faint);
}

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

@media (max-width: 600px) {
  .mark {
    padding: 1.5rem 0 0 1.25rem;
  }

  main {
    padding: 2rem 1.25rem 4rem;
  }

  .intro h1 {
    font-size: 1.35rem;
  }

  .intro p {
    font-size: 0.9rem;
  }
}

/* ---- Accessibility ---- */

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

@media (prefers-contrast: more) {
  body::before { display: none; }
  :root {
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.7);
    --text-faint: rgba(255, 255, 255, 0.5);
  }
  .intro h1, h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
  }
}
