/* Personal site — warm & personal, slightly playful */

:root {
  --bg: oklch(0.97 0.012 75);
  --bg-tint: oklch(0.94 0.018 75);
  --ink: oklch(0.22 0.02 60);
  --ink-soft: oklch(0.42 0.018 60);
  --ink-mute: oklch(0.58 0.015 60);
  --rule: oklch(0.86 0.02 70);
  --paper: oklch(0.99 0.008 80);
  --accent: oklch(0.62 0.14 40);
  --accent-soft: oklch(0.88 0.06 45);
  --accent-ink: oklch(0.32 0.1 35);

  --display: "Fraunces", "Cooper", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --pad: clamp(20px, 4vw, 64px);
  --gap: 24px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* density tweak */
body[data-density="cozy"] { font-size: 16px; }
body[data-density="cozy"] .section { padding-block: 56px; }
body[data-density="airy"]  { font-size: 18px; }
body[data-density="airy"]  .section { padding-block: 112px; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

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

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: var(--pad);
}

.section { padding-block: 84px; position: relative; }
.section + .section { border-top: 1px dashed var(--rule); }

.section-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.section-eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--ink-mute);
}

.section-title {
  font-family: var(--display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--ink);
}
.section-title em {
  font-style: normal;
  background: linear-gradient(180deg, transparent 62%, var(--accent-soft) 62% 92%, transparent 92%);
  padding: 0 4px;
}

.section-lede {
  max-width: 56ch;
  color: var(--ink-soft);
  margin: 0 0 40px;
  font-size: 1.05em;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
  transform: translateY(-1px);
}
.nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--ink-soft);
}
.nav a { transition: color .15s; }
.nav a:hover { color: var(--ink); }
.nav-cta {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  transition: transform .15s, background .15s;
}
.nav-cta:hover { transform: translateY(-1px); background: var(--accent-ink); }
@media (max-width: 720px) { .nav { display: none; } }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.social-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  transition: color .15s, background .15s, transform .15s;
}
.social-icon:hover {
  color: var(--accent-ink);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
@media (max-width: 540px) {
  .social-icon { display: none; }
}

.articles-more {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}
.articles-more .btn .chev {
  display: inline-block;
  transition: transform .25s;
  margin-left: 4px;
}
.articles-more .btn .chev.up { transform: rotate(180deg); }

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

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
  padding-block: 72px 96px;
}
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-block: 48px 72px; }
}

.hero-hi {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out infinite; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

.hero-title {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(40px, 5.8vw, 76px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}
.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent-ink);
}
.hero-sub {
  font-size: 1.15em;
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0 0 28px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { transform: translateY(-1px); background: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--rule); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }

/* video card */
.video-card {
  position: relative;
  aspect-ratio: 9 / 16;
  max-width: 360px;
  margin-inline: auto;
  background: var(--paper);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,.6) inset,
    0 30px 60px -30px rgba(60, 30, 0, 0.25),
    0 8px 20px -10px rgba(60, 30, 0, 0.15);
  transform: rotate(1.2deg);
  transition: transform .35s cubic-bezier(.3,.7,.4,1);
}
.video-card:hover { transform: rotate(0); }
.video-card[data-size="large"] { max-width: 420px; }
.video-card[data-size="small"] { max-width: 300px; }

.video-stage {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      135deg,
      oklch(0.85 0.04 50) 0 8px,
      oklch(0.88 0.04 50) 8px 16px
    );
  display: grid;
  place-items: center;
}
.video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.video-play {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  background: var(--paper);
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 12px 30px -8px rgba(60,30,0,0.35);
  transition: transform .2s;
}
.video-play:hover { transform: scale(1.06); }
.video-play svg { transform: translateX(2px); }
.video-meta {
  position: absolute;
  left: 18px;
  bottom: 16px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.video-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 110px;
  height: 26px;
  background: color-mix(in oklab, var(--accent-soft) 70%, transparent);
  border-radius: 2px;
}

/* sticker note */
.hero-note {
  position: absolute;
  right: -8px;
  top: -16px;
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  background: var(--paper);
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 18px -6px rgba(60,30,0,.25);
  transform: rotate(6deg);
  border: 1px solid var(--rule);
}

/* ---------- Stats strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat {
  padding: 8px 18px;
  border-right: 1px dashed var(--rule);
}
.stat:last-child { border-right: 0; }
.stat-num {
  font-family: var(--display);
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.stat-num span {
  color: var(--accent);
  font-style: italic;
}
.stat-lbl {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 8px;
}
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: 0; border-bottom: 1px dashed var(--rule); padding: 14px 0; }
  .stat:nth-child(odd) { border-right: 1px dashed var(--rule); padding-right: 14px; }
  .stat:nth-child(even) { padding-left: 14px; }
  .stat:nth-last-child(-n+2) { border-bottom: 0; }
}

/* ---------- Speaking gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: 240px 240px;
  gap: 18px;
}
.gallery .ph {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 12px 28px -16px rgba(60,30,0,.18);
  transition: transform .3s cubic-bezier(.3,.7,.4,1);
}
.gallery .ph:hover { transform: translateY(-3px); }
.gallery .ph:nth-child(1) { grid-row: span 2; }
.gallery .ph:nth-child(4) { grid-column: span 2; }

.ph-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ph-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0) 40%,
    rgba(0,0,0,0.55) 100%
  );
  pointer-events: none;
}

.ph-fill {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      45deg,
      oklch(0.78 0.03 60) 0 10px,
      oklch(0.82 0.03 60) 10px 20px
    );
}
.ph-fill.warm {
  background:
    repeating-linear-gradient(
      -45deg,
      oklch(0.82 0.06 50) 0 10px,
      oklch(0.86 0.06 50) 10px 20px
    );
}
.ph-fill.cool {
  background:
    repeating-linear-gradient(
      45deg,
      oklch(0.78 0.04 220) 0 10px,
      oklch(0.82 0.04 220) 10px 20px
    );
}
.ph-fill.deep {
  background:
    repeating-linear-gradient(
      90deg,
      oklch(0.45 0.06 40) 0 10px,
      oklch(0.49 0.06 40) 10px 20px
    );
}

.ph-tag {
  position: absolute;
  left: 14px;
  top: 14px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--ink);
}
.ph-cap {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  color: var(--paper);
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

@media (max-width: 880px) {
  .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 200px 200px 200px; }
  .gallery .ph:nth-child(1) { grid-row: auto; grid-column: span 2; }
  .gallery .ph:nth-child(4) { grid-column: auto; }
}

/* ---------- Services ---------- */

.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.service {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .25s cubic-bezier(.3,.7,.4,1), box-shadow .25s;
  position: relative;
  overflow: hidden;
}
.service:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 30px -16px rgba(60,30,0,0.18);
}
.service-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
}
.service-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}
.service-desc {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
  flex: 1;
}
.service-cta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.service-cta::after {
  content: "→";
  transition: transform .2s;
}
.service:hover .service-cta::after { transform: translateX(3px); }

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

/* ---------- GitHub ---------- */

.repos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.repo {
  display: block;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform .25s, border-color .25s;
}
.repo:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.repo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.repo-head svg { color: var(--ink-mute); }
.repo-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
}
.repo-name span { color: var(--ink-mute); font-weight: 400; }
.repo-desc {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 4px 0 14px;
}
.repo-meta {
  display: flex;
  gap: 16px;
  font-size: 12.5px;
  color: var(--ink-mute);
  font-family: var(--mono);
}
.repo-meta span { display: inline-flex; align-items: center; gap: 6px; }
.lang-dot {
  width: 9px; height: 9px; border-radius: 999px; display: inline-block;
}

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

/* ---------- Articles ---------- */

.articles {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}
.article {
  border-bottom: 1px solid var(--rule);
  padding: 24px 0;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 28px;
  align-items: baseline;
  cursor: pointer;
  transition: padding .25s;
}
.article:hover { padding-left: 12px; }
.article-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.article-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}
.article-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.article-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: 1px solid var(--rule);
  padding: 2px 8px;
  border-radius: 999px;
}
.article-arrow {
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink-mute);
  transition: transform .25s, color .25s;
}
.article:hover .article-arrow {
  transform: rotate(45deg);
  color: var(--accent);
}
.article[data-open="true"] .article-arrow { transform: rotate(135deg); color: var(--accent); }

.article-body {
  grid-column: 2 / -1;
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, margin .3s ease;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.7;
}
.article[data-open="true"] .article-body {
  max-height: 1200px;
  margin-top: 18px;
}
.article-body p { margin: 0 0 14px; }
.article-body p:first-child::first-letter {
  font-family: var(--display);
  font-size: 3em;
  float: left;
  line-height: 0.9;
  padding: 4px 8px 0 0;
  color: var(--accent-ink);
}
.article-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  margin-top: 6px;
}

@media (max-width: 720px) {
  .article { grid-template-columns: 1fr auto; gap: 8px 16px; padding: 20px 0; }
  .article-date { grid-column: 1 / -1; }
  .article-body { grid-column: 1 / -1; }
}

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

.cf {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.cf-row { display: flex; gap: 14px; }
.cf-2 > * { flex: 1; min-width: 0; }
@media (max-width: 540px) { .cf-row { flex-direction: column; } }

.cf-field { display: flex; flex-direction: column; gap: 6px; }
.cf-field > span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.cf-field input,
.cf-field textarea {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
  resize: vertical;
}
.cf-field input::placeholder,
.cf-field textarea::placeholder { color: var(--ink-mute); }
.cf-field input:focus,
.cf-field textarea:focus {
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent-soft) 60%, transparent);
}
.cf-field.err input,
.cf-field.err textarea {
  border-color: oklch(0.55 0.18 25);
  background: color-mix(in oklab, oklch(0.55 0.18 25) 6%, var(--paper));
}
.cf-field em {
  font-style: normal;
  font-size: 12px;
  color: oklch(0.45 0.18 25);
  font-family: var(--sans);
}
.cf-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.cf-note {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

.contact {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 28px;
  padding: clamp(36px, 6vw, 72px);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: start;
  position: relative;
  overflow: hidden;
}
.contact::before {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: var(--accent-soft);
  opacity: 0.6;
}
.contact-inner {
  position: relative;
}
.contact-inner .section-eyebrow { margin-bottom: 18px; }
.contact-title {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(26px, 2.8vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.contact-title em {
  font-style: italic;
  color: var(--accent-ink);
}
.contact-title .ct-line {
  display: block;
  white-space: nowrap;
}
@media (max-width: 540px) {
  .contact-title .ct-line { white-space: normal; }
}
.contact-sub {
  color: var(--ink-soft);
  margin: 0 0 28px;
  font-size: 1.05em;
  max-width: 42ch;
}
.contact-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.contact-detail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
}
.contact-detail .row {
  display: flex;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--rule);
}
.contact-detail .row:last-child { border-bottom: 0; }
.contact-detail .row b { color: var(--ink); font-weight: 500; }

@media (max-width: 880px) {
  .contact { grid-template-columns: 1fr; padding: 36px 28px; }
}

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

.footer {
  padding: 36px 0 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { transition: color .15s; }
.footer-links a:hover { color: var(--ink); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s, transform .7s; }
.reveal.in { opacity: 1; transform: none; }
