/* ========================================
   wasay.dev
   ======================================== */

:root {
  --bg: #fafaf8;
  --bg-subtle: #f3f3f0;
  --text: #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-tertiary: #999;
  --accent: #c45d3e;
  --accent-hover: #a84832;
  --accent-glow: rgba(196, 93, 62, 0.12);
  --border: #e8e8e4;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 680px;
  --transition: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --bg-subtle: #1a1a18;
    --text: #e8e8e4;
    --text-secondary: #999;
    --text-tertiary: #666;
    --accent: #e07a5f;
    --accent-hover: #c45d3e;
    --accent-glow: rgba(224, 122, 95, 0.1);
    --border: #2a2a28;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  opacity: 0;
  animation: pageIn 0.6s ease 0.05s forwards;
}

@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

.grain {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 1000; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* --- Nav --- */
.site-header { padding: 48px 0 0; }

nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.nav-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-name {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: color 0.3s ease, transform 0.2s ease;
}

.nav-name:hover { color: var(--accent); transform: translateY(-1px); }

.location-widget {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.location-pin { font-size: 11px; }
.location-sep { color: var(--border); font-size: 10px; }
.location-time { font-variant-numeric: tabular-nums; }

.nav-links { display: flex; gap: 28px; padding-top: 4px; }

.nav-links a {
  font-size: 15px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

/* --- Hero --- */
.hero { padding: 100px 0 48px; }

.hero-greeting {
  font-family: var(--serif);
  font-size: 21px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-style: italic;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 6vw, 46px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-bottom: 40px;
}

.hero-bio p {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.85;
  margin-bottom: 16px;
}

.hero-bio a {
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.hero-bio a:hover { border-bottom-color: transparent; }

/* --- Places --- */
.places {
  padding-bottom: 12px;
}

.places h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

.places-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.place-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  transition: border-color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.place-tag:hover {
  border-color: var(--text-tertiary);
  background: var(--bg-subtle);
}

.place-tag.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* --- Divider --- */
.divider {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 0;
}

.dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--border);
  transition: transform 0.4s ease, background 0.4s ease;
}

.dot.pulse { animation: dotPulse 0.6s ease; }

@keyframes dotPulse {
  0% { transform: scale(1); }
  50% { transform: scale(2.5); background: var(--accent); }
  100% { transform: scale(1); }
}

/* --- Section headings --- */
.work h2, .learnings h2, .content-section h2, .people h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-tertiary);
  font-size: 15px;
  margin-bottom: 20px;
}

/* === Horizontal Timeline === */
.work { padding-bottom: 8px; }

.h-timeline {
  margin-top: 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}

.h-timeline::-webkit-scrollbar { height: 0; }

.h-timeline-track {
  display: flex;
  align-items: flex-start;
  position: relative;
  min-width: max-content;
  padding: 0 4px;
}

.h-timeline-line {
  position: absolute;
  top: 8px; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}

.h-timeline-entry {
  position: relative;
  flex: 0 0 200px;
  padding-top: 28px;
  padding-right: 24px;
}

.h-timeline-dot {
  position: absolute;
  top: 4px; left: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg);
  transition: background 0.3s ease;
}

.h-timeline-dot.active {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.h-timeline-entry:hover .h-timeline-dot { background: var(--accent); }

.h-timeline-year {
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.h-timeline-label h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 6px;
  line-height: 1.3;
}

.h-timeline-label p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 190px;
}

/* --- Writing --- */
.empty-state {
  color: var(--text-tertiary);
  font-size: 15px;
  font-style: italic;
}

/* --- Content I've Liked --- */
.content-section { padding-bottom: 8px; }

.see-more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.see-more-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.see-more-link .arrow {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.see-more-link:hover .arrow {
  transform: translateX(4px);
}

/* --- People --- */
.people { padding-bottom: 8px; }

.people-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.person-preview-link {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.person-preview-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.preview-sep {
  color: var(--text-tertiary);
  font-size: 12px;
}

.preview-more {
  font-size: 14px;
  color: var(--text-tertiary);
  font-style: italic;
}

.people-entries {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.person-entry h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 6px;
}

.person-entry h3 a {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.person-entry h3 a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.person-entry p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* --- Footer --- */
.site-footer { padding: 20px 0 80px; text-align: center; }
.footer-cta { margin-bottom: 32px; }

.footer-cta p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 14px;
}

.email-link {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: all 0.3s ease;
  display: inline-block;
}

.email-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  transform: translateY(-1px);
}

.footer-links { margin-bottom: 24px; }

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--text); }

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-greeting, .hero h1, .hero-bio p {
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.hero-greeting { animation-delay: 0.15s; }
.hero h1 { animation-delay: 0.3s; }
.hero-bio p:nth-child(1) { animation-delay: 0.5s; }

.reveal-section {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-section.revealed { opacity: 1; transform: translateY(0); }

.reveal-item { opacity: 0; transform: translateY(14px); }
.reveal-item.revealed { opacity: 1; transform: translateY(0); }

.scroll-hint {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  opacity: 0; transition: opacity 0.4s ease;
  pointer-events: none; z-index: 100;
}

.scroll-hint.visible { opacity: 1; }

.scroll-hint span {
  display: block; width: 2px; height: 20px;
  background: var(--text-tertiary);
  margin: 0 auto; border-radius: 1px;
  animation: scrollBounce 1.8s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* --- Sub-page shared --- */
.subpage-header { padding: 48px 0 0; }

.subpage-back {
  font-size: 14px;
  color: var(--text-tertiary);
  transition: color 0.2s ease;
}

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

.subpage-content { padding: 48px 0 80px; }

.subpage-content h1 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  margin-bottom: 8px;
}

.subpage-content .section-desc { margin-bottom: 40px; }

.content-entry {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.content-entry:last-child { border-bottom: 1px solid var(--border); }

.content-entry h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
  margin-bottom: 4px;
}

.content-entry h3 a {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.content-entry h3 a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.content-entry .content-type {
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.content-entry p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.content-note {
  font-size: 14px;
  color: var(--text-tertiary);
  font-style: italic;
  margin-top: 40px;
}

/* --- Learnings preview row --- */
.learning-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 16px;
  color: var(--text-secondary);
}

/* --- Essay body (sub-page prose) --- */
.essay-body p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 16px;
}

.essay-body h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  color: var(--text);
  margin: 40px 0 12px;
  letter-spacing: -0.005em;
}

.essay-body h2:first-child {
  margin-top: 8px;
}

.essay-body .essay-coda {
  color: var(--text-secondary);
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 15px;
}

/* --- Agency chart (line art SVG) --- */
.agency-chart {
  margin: 48px 0;
}

.agency-chart svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
}

.agency-chart .chart-axis {
  stroke: var(--border);
  stroke-width: 1;
}

.agency-chart .chart-curve {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
}

.agency-chart .chart-stop {
  stroke: var(--text-tertiary);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.agency-chart .chart-dot-muted {
  fill: var(--text-tertiary);
}

.agency-chart .chart-dot-accent {
  fill: var(--accent);
}

.agency-chart .chart-text-muted {
  fill: var(--text-tertiary);
  font-family: var(--sans);
  font-size: 13px;
}

.agency-chart .chart-text-accent {
  fill: var(--accent);
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
}

.agency-chart figcaption {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 14px;
  font-style: italic;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .site-header { padding: 28px 0 0; }
  .hero { padding: 56px 0 36px; }
  .hero h1 { font-size: 30px; line-height: 1.3; }
  .hero-greeting { font-size: 19px; }
  .hero-bio p { font-size: 16px; }
  .nav-links { gap: 22px; }
  .nav-links a { font-size: 14px; }
  .nav-name { font-size: 20px; }
  .location-widget { font-size: 11px; }

  .work h2, .learnings h2, .content-section h2, .people h2 { font-size: 24px; }

  .h-timeline-entry { flex: 0 0 180px; }
  .h-timeline-label p { max-width: 160px; font-size: 13px; }
  .h-timeline-label h3 { font-size: 16px; }

  .places h2 { font-size: 18px; }
  .place-tag { font-size: 12px; padding: 5px 12px; }

  .person-entry h3 { font-size: 18px; }
  .person-entry p { font-size: 14.5px; }

  .learning-preview { font-size: 15px; }

  .essay-body p { font-size: 16px; line-height: 1.65; margin-bottom: 14px; }
  .essay-body h2 { font-size: 19px; margin: 32px 0 10px; }
  .essay-body .essay-coda { margin-top: 32px; padding-top: 22px; font-size: 14px; }

  .agency-chart { margin: 36px 0; }
  .agency-chart svg { max-height: 220px; }
  .agency-chart figcaption { font-size: 13px; }

  .divider { padding: 36px 0; }
  .email-link { font-size: 20px; }
  .email-link:hover { transform: none; }
  .footer-cta p { font-size: 14px; }
  .footer-links a { font-size: 13px; }
  .site-footer { padding: 16px 0 60px; }
  main { padding: 0 20px; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 26px; }
  main { padding: 0 16px; }
}