/* ==========================================================================
   ruby wang — personal site
   White page, mixed serif/sans type, one painted moment (the koi pond).
   ========================================================================== */

:root {
  --page: #ffffff;
  --ink: #1f1e1c;
  --soft: #55534d;
  --muted: #8b887f;
  --line: #ecebe6;
  --wash: #f5f4f0;
  --accent: #d4553a;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --hand: "Caveat", "Bradley Hand", cursive;

  --col: 680px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 15px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
p { margin: 0; }
em { font-style: italic; }

.wrap {
  width: min(var(--col), calc(100vw - 32px));
  margin: 0 auto;
}

/* ---------- nav ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 0;
}
.mark {
  font: italic 400 26px/1 var(--serif);
}
.nav ul {
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}
.nav a { transition: color 0.2s ease; }
.nav a:hover,
.nav a[aria-current="page"] { color: var(--ink); }

/* ---------- type ---------- */

.display {
  margin: 0;
  font: 400 clamp(44px, 9vw, 64px)/1.05 var(--serif);
  letter-spacing: -0.01em;
}
.section-title {
  margin: 0 0 18px;
  font: 400 26px/1.2 var(--serif);
}
.lede {
  margin-top: 14px;
  font-size: 16px;
  color: var(--soft);
}
.meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.hand {
  font-family: var(--hand);
  color: var(--accent);
  font-size: 19px;
  line-height: 1.1;
}
.placeholder {
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
}

/* ---------- hero ---------- */

.hero {
  padding: 120px 0 96px;
  text-align: center;
}
.page-hero {
  padding: 96px 0 48px;
}

section + section { margin-top: 88px; }

/* ---------- launch log ---------- */

.log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.log-head .hand { transform: rotate(-3deg); }

.stat {
  display: block;
  font: 400 34px/1 var(--serif);
  letter-spacing: -0.01em;
}
.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.stats > div {
  padding: 18px 18px 16px;
  border-radius: 14px;
  background: var(--wash);
}
.stats > div:nth-child(1) { background: #f8ebe2; }
.stats > div:nth-child(2) { background: #e9efe7; }
.stats > div:nth-child(3) { background: #e7eef5; }

.log { margin: 0; padding: 0; list-style: none; }
.log li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.log li:last-child { border-bottom: 1px solid var(--line); }
.log-when {
  font-size: 13px;
  color: var(--muted);
  padding-top: 2px;
}
.log-what h3 {
  margin: 0;
  font: 500 15px/1.4 var(--sans);
}
.log-what h3 span { font-weight: 400; color: var(--muted); }
.log-what p {
  margin-top: 4px;
  font-size: 14px;
  color: var(--soft);
}
.tag {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.log-result { text-align: right; min-width: 96px; }
.log-result .stat { font-size: 30px; }

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .stats > div { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px; }
  .stats .stat-label { margin: 0; }
  .log li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; }
  .log-when { grid-column: 1 / -1; }
  .nav ul { gap: 14px; }
}

/* ---------- projects ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 20px;
}
.project { display: block; }
.project .thumb {
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background: var(--wash);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
}
.project:hover .thumb { transform: translateY(-4px); }
.project h3 {
  margin: 12px 0 0;
  font: 500 14px/1.4 var(--sans);
}
.project p {
  font-size: 13px;
  color: var(--muted);
}
.t-peach { background: #f8ebe2 !important; }
.t-sage  { background: #e9efe7 !important; }
.t-sky   { background: #e7eef5 !important; }
.t-butter{ background: #f7f1df !important; }

@media (max-width: 560px) {
  .projects { grid-template-columns: 1fr; }
}

/* ---------- contact ---------- */

.contact p { color: var(--soft); }
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 14px;
  font-size: 14px;
}
.links a {
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease;
}
.links a:hover { border-color: var(--ink); }

/* ---------- lists (writing / now / about) ---------- */

.rows { margin: 0; padding: 0; list-style: none; }
.rows li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.rows li:last-child { border-bottom: 1px solid var(--line); }
.rows .when { color: var(--muted); font-size: 13px; white-space: nowrap; }

.prose p + p { margin-top: 14px; }
.prose p { color: var(--soft); }

.portrait {
  width: 160px;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  background: var(--wash);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 28px;
}

/* ---------- the pond ---------- */

.pond-section {
  margin-top: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pond {
  position: relative;
  width: min(920px, calc(100vw - 16px));
  aspect-ratio: 16 / 9;
  border-radius: 32px;
  overflow: hidden;
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  /* feather every edge into the white page */
  -webkit-mask-image:
    linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent),
    linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
  mask-composite: intersect;
}
.pond canvas {
  opacity: 0;
  transition: opacity 1.2s ease;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.pond.ready canvas { opacity: 1; }
.pond-talk {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.remark {
  position: absolute;
  transform: translate(-50%, -100%);
  font: 500 22px/1 var(--hand);
  color: #fffaf2;
  text-shadow: 0 1px 6px rgba(20, 40, 36, 0.55);
  white-space: nowrap;
  animation: remark 2.2s ease forwards;
}
@keyframes remark {
  0%   { opacity: 0; translate: 0 6px; }
  15%  { opacity: 1; translate: 0 0; }
  75%  { opacity: 1; }
  100% { opacity: 0; translate: 0 -10px; }
}
@media (max-width: 720px) {
  .pond { aspect-ratio: 4 / 3; border-radius: 22px; }
}

.pond-top { margin-top: 28px; }
.pond-top + .wrap .hero { padding-top: 56px; }

.pond-caption {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.tod {
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  border-bottom: 1px dashed var(--muted);
  cursor: pointer;
}

/* ---------- footer ---------- */

.foot {
  padding: 28px 0 40px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.foot a { border-bottom: 1px solid var(--line); }
