:root {
  --paper: #faf7f0;
  --ink: #14120e;
  --ink-muted: #5e5a52;
  --ink-faint: #8a857a;
  --rule: #d9d4c6;
  --accent: #3d2f1f;
  --measure: 38rem;
  --measure-wide: 44rem;
  --step: clamp(1rem, 0.9rem + 0.4vw, 1.0625rem);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--step);
  line-height: 1.6;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 6rem) clamp(1.5rem, 5vw, 2.5rem) clamp(2rem, 6vh, 4rem);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 9vh, 5.5rem);
  animation: rise 900ms cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Masthead ────────────────────────────────── */
.masthead {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wordmark,
.wordmark-small {
  background-image: linear-gradient(
    100deg,
    #10b981 0%,
    #06b6d4 14%,
    #0ea5e9 28%,
    #3b82f6 44%,
    #6366f1 60%,
    #8b5cf6 76%,
    #a855f7 88%,
    #10b981 100%
  );
  background-size: 260% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  filter:
    drop-shadow(0 0 14px rgba(16, 185, 129, 0.28))
    drop-shadow(0 0 28px rgba(99, 102, 241, 0.22))
    drop-shadow(0 0 40px rgba(6, 182, 212, 0.18));
  animation: shimmer 11s linear infinite;
}

.wordmark {
  font-family: 'Fraunces', 'Iowan Old Style', 'Palatino', Georgia, serif;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(3rem, 10vw, 5.25rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0;
  font-variation-settings: "opsz" 144, "SOFT" 30;
}

.wordmark .suffix {
  font-size: 0.38em;
  letter-spacing: 0.12em;
  vertical-align: 0.55em;
  font-weight: 400;
  margin-left: 0.25em;
  font-variation-settings: "opsz" 14;
}

.wordmark-small {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: inline-block;
}

.wordmark-small .suffix {
  font-size: 0.62em;
  letter-spacing: 0.1em;
  margin-left: 0.2em;
  vertical-align: 0.15em;
}

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 260% 50%; }
}

.descriptor {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--ink-muted);
  letter-spacing: 0.005em;
  margin: 0;
  max-width: 32rem;
}

/* ─── Portfolio ───────────────────────────────── */
.portfolio {
  padding-top: clamp(1rem, 3vh, 2rem);
  border-top: 1px solid var(--rule);
}

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.projects li {
  --splash: var(--ink);
  position: relative;
  isolation: isolate;
  border-bottom: 1px solid var(--rule);
}

.projects li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 68%;
  background: var(--splash);
  border-radius: 3px;
  box-shadow: 0 0 14px 0 var(--splash);
  opacity: 0;
  transform: translateY(-50%) scaleY(0.6);
  transform-origin: center;
  transition: opacity 260ms ease, transform 260ms cubic-bezier(0.2, 0.6, 0.2, 1);
  pointer-events: none;
  z-index: 1;
}

.projects li::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    color-mix(in oklab, var(--splash) 22%, transparent) 0%,
    color-mix(in oklab, var(--splash) 8%, transparent) 35%,
    transparent 75%
  );
  opacity: 0;
  transition: opacity 320ms ease;
  pointer-events: none;
  z-index: 0;
}

.projects a {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem 1.5rem;
  padding: 1.35rem 0;
  text-decoration: none;
  color: var(--ink);
  transition: transform 280ms cubic-bezier(0.2, 0.6, 0.2, 1);
  position: relative;
  z-index: 2;
  outline: none;
}

.projects li:hover a,
.projects li:focus-within a {
  transform: translateX(1rem);
}

.projects li:hover::before,
.projects li:focus-within::before {
  opacity: 1;
  transform: translateY(-50%) scaleY(1);
}

.projects li:hover::after,
.projects li:focus-within::after {
  opacity: 1;
}

.projects li:hover a .project-name,
.projects li:focus-within a .project-name {
  color: var(--splash);
  transition: color 260ms ease;
}

.project-name {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.35rem, 2.8vw, 1.65rem);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.project-domain {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: lowercase;
}

.project-desc {
  font-size: 0.98rem;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-top: 0.2rem;
  max-width: 34rem;
}

@media (min-width: 640px) {
  .projects a {
    grid-template-columns: minmax(12rem, auto) 1fr;
    grid-template-rows: auto auto;
    column-gap: 2rem;
    align-items: baseline;
  }
  .project-name {
    grid-column: 1;
    grid-row: 1;
  }
  .project-domain {
    grid-column: 1;
    grid-row: 2;
  }
  .project-desc {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    margin-top: 0;
  }
}

/* ─── Footer ──────────────────────────────────── */
.colophon {
  margin-top: auto;
  padding-top: clamp(2rem, 5vh, 3rem);
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  letter-spacing: 0.01em;
}

.colophon p {
  margin: 0;
}

.colophon-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.colophon a {
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 220ms ease, border-color 220ms ease;
}

.colophon a:hover,
.colophon a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--ink-faint);
  outline: none;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  .projects a { transition: none; }
  .projects li::before,
  .projects li::after { transition: none; }
  .wordmark,
  .wordmark-small { animation: none; }
}
