/* === Tokens === */
:root {
  --bg: #0d0e12;
  --bg-elevated: #14161c;
  --bg-card: #181a21;
  --text: #ece9e2;
  --text-muted: #8a8b91;
  --text-faint: #4a4b50;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #3bb3a8;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-w: 64rem;
  --reading-max-w: 40rem;
  --radius: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* === Hero === */
.hero {
  text-align: center;
  padding: 7rem 1.5rem 5rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.profile-photo-frame {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--bg-elevated);
  box-shadow:
    0 0 0 1px var(--border),
    0 30px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%) contrast(1.05);
  transition: filter 0.6s ease;
}

.profile-photo-frame:hover .profile-photo {
  filter: grayscale(0%) contrast(1);
}

.hero-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1.75rem;
}

.hero-name-given {
  font-weight: 400;
  color: var(--text);
}

.hero-role {
  font-family: 'Fraunces', var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.55rem, 3.2vw, 2.35rem);
  line-height: 1.3;
  letter-spacing: 0.005em;
  color: var(--text-muted);
  margin: -0.25rem 0 2rem;
}

.hero-name-family {
  font-style: italic;
  font-weight: 700;
}

.contact-icons {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.contact-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.25s, border-color 0.25s, transform 0.25s;
}

.contact-icons a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.contact-icons svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* === Sections === */
.section {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 6rem 1.5rem;
}

.section[data-number]::before {
  content: attr(data-number);
  position: absolute;
  top: 3.5rem;
  right: 1.5rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(7rem, 16vw, 13rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--text);
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
}

.section-eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin: 0 0 1rem;
  font-weight: 500;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 2rem;
  max-width: 32ch;
}

.section-lede {
  color: var(--text-muted);
  max-width: 50ch;
  margin: 0 0 2rem;
}

/* === About === */
.about-quote {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.5;
  margin: 0 0 2rem;
  padding: 0.5rem 0 0.5rem 1.5rem;
  border-left: 2px solid var(--accent);
  color: var(--text);
  max-width: 38rem;
}

.about-bio {
  color: var(--text);
  max-width: 60ch;
  margin: 0 0 1.5rem;
  font-size: clamp(1.15rem, 1.7vw, 1.35rem);
  line-height: 1.7;
  text-align: justify;
}

.about-bio:last-child {
  margin-bottom: 0;
}

.about-intro {
  margin-bottom: 1rem;
  font-size: clamp(1.15rem, 1.7vw, 1.35rem);
  letter-spacing: 0.01em;
  text-align: justify;
}

.about-stanza {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1.15rem, 1.7vw, 1.35rem);
  line-height: 1.7;
  letter-spacing: 0.005em;
  max-width: 58ch;
  margin: 2.25rem 0 2.5rem;
  color: var(--text);
  text-align: justify;
}

.about-signoff {
  margin-top: 2.5rem;
  text-align: left;
}

.signoff-smile {
  font-family: var(--sans);
  font-style: normal;
  color: var(--accent);
  letter-spacing: 0;
  margin-left: 0.15em;
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius);
  transition: border-color 0.25s, color 0.25s, background 0.25s, transform 0.25s;
}

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

.btn-primary {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
}

/* === Tech strip === */
.tech-strip {
  padding: 4rem 0;
  margin: 4rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.tech-eyebrow {
  text-align: center;
  margin-bottom: 2.5rem;
}

.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  width: max-content;
  list-style: none;
  margin: 0;
  padding: 1rem 0;
  animation: marquee-scroll 55s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.tech-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  flex-shrink: 0;
  width: 96px;
  padding: 1rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

.tech-item img {
  height: 42px;
  width: 42px;
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
  transition: transform 0.35s ease, opacity 0.35s ease, filter 0.35s ease;
}

.tech-item span {
  font-family: 'Nunito', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.35s ease;
}

.tech-item:hover {
  transform: translateY(-6px);
  border-color: var(--border);
  background: linear-gradient(180deg, rgba(59, 179, 168, 0.08), rgba(59, 179, 168, 0));
}

.tech-item:hover img {
  opacity: 1;
  transform: scale(1.08);
  filter: drop-shadow(0 6px 14px rgba(59, 179, 168, 0.35));
}

.tech-item:hover span {
  color: var(--accent);
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* === Docs cards === */
.doc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: grid;
  gap: 0.75rem;
}

.doc-list a {
  display: block;
  padding: 1.5rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}

.doc-list a:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  background: #1d1f27;
}

.doc-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.doc-blurb {
  display: block;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* === Site footer === */
.site-footer {
  text-align: center;
  padding: 5rem 1.5rem 2.5rem;
  color: var(--text-faint);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* === Reading pages (resume + docs/<slug>) === */
.reading {
  background: var(--bg);
}

.reading-header,
.reading-footer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 1.1rem 2rem;
  background: rgba(13, 14, 18, 0.78);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  transition: opacity 0.5s ease;
}

.reading-header {
  top: 0;
  border-bottom: 1px solid var(--border);
}

.reading-footer {
  bottom: 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.reading-header.dimmed,
.reading-footer.dimmed {
  opacity: 0.18;
}

.reading-header.dimmed:hover,
.reading-footer.dimmed:hover,
.reading-header.dimmed:focus-within,
.reading-footer.dimmed:focus-within {
  opacity: 1;
}

.reading-home,
.back-home {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  transition: color 0.25s;
}

.reading-home:hover,
.back-home:hover {
  color: var(--accent);
}

.reading-content {
  max-width: var(--reading-max-w);
  margin: 0 auto;
  padding: 9rem 1.5rem 9rem;
}

.reading-content h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 2rem;
}

.reading-content h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 3rem 0 1rem;
}

.reading-content h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin: 2.25rem 0 0.75rem;
}

.reading-content p,
.reading-content li {
  color: #d2cfc8;
}

.reading-content p { margin: 1rem 0; }

.reading-footer-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.doc-article {
  display: grid;
  gap: 2.5rem;
}

.doc-top {
  margin-bottom: 0.25rem;
}

.doc-kicker {
  margin: 0 0 0.9rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--accent);
}

.doc-title-main {
  margin: 0;
}

.doc-intro {
  margin: 1rem 0 0;
  color: var(--text-muted);
  max-width: 60ch;
}

.doc-highlights h2,
.doc-embed-wrap h2 {
  margin-top: 0;
}

.doc-highlights ul {
  margin: 0;
  padding-left: 1.2rem;
}

.doc-highlights p {
  margin: 0.6rem 0;
  color: var(--text-muted);
  max-width: 60ch;
}

.doc-highlights blockquote {
  margin: 0.9rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
  font-style: italic;
  max-width: 60ch;
}

.doc-embed-wrap p {
  color: var(--text-muted);
}

.doc-embed {
  width: 100%;
  min-height: 74vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #11131a;
}

/* === Docs index page === */
.page-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

body > main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

body > main > h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 5vw, 3.25rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

/* === Resume page === */
.resume-top {
  text-align: center;
  margin-bottom: 4rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.resume-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 6.5vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

.resume-name-given {
  font-weight: 400;
  color: var(--text-muted);
}

.resume-name-family {
  font-style: italic;
  font-weight: 700;
}

.resume-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-size: 1.05rem;
  margin: 0 0 1.75rem;
  letter-spacing: 0.01em;
}

.resume-contacts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.resume-contacts li {
  position: relative;
}

.resume-contacts li + li::before {
  content: "";
  position: absolute;
  left: -0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 0.85rem;
  background: var(--border-strong);
}

.resume-contacts a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.25s;
}

.resume-contacts a:hover {
  color: var(--accent);
}

.resume-section {
  margin-bottom: 3rem;
}

.resume-section:last-child {
  margin-bottom: 0;
}

.resume-section > h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.85rem;
  letter-spacing: -0.005em;
  margin: 0 0 1.5rem;
  color: var(--text);
  position: relative;
  padding-bottom: 0.65rem;
}

.resume-section > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.25rem;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.role,
.work {
  margin-bottom: 1.75rem;
}

.role:last-child,
.work:last-child {
  margin-bottom: 0;
}

.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  margin-bottom: 0.4rem;
}

.role-dates {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.role-title,
.work-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0;
  color: var(--text);
}

.role-pos {
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
}

.role > p,
.work > p {
  margin: 0.4rem 0 0;
  color: #d2cfc8;
}

.work-title {
  margin-bottom: 0.4rem;
}

.work-doc-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, transform 0.25s;
}

.work-doc-link:hover {
  border-bottom-color: var(--accent);
  transform: translateX(3px);
}

.skills {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem 1.5rem;
  margin: 0;
  padding: 1.5rem 1.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.skills dt {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  padding-top: 0.35rem;
}

.skills dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
}

.skills dd span {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text);
  padding: 0.3rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.skills dd span:hover {
  background: rgba(59, 179, 168, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 600px) {
  .resume-top { margin-bottom: 3rem; padding-bottom: 2rem; }
  .skills {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem 1.4rem;
  }
  .skills dt { padding-top: 0; }
  .resume-contacts { gap: 0.4rem 1rem; }
  .resume-contacts li + li::before { display: none; }
}

/* === 404 === */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-page > main {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.error-stage {
  position: relative;
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem 0;
  text-align: center;
}

.error-stage[data-number]::before {
  content: attr(data-number);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(14rem, 38vw, 24rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--text);
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  white-space: nowrap;
}

.error-stage > * {
  position: relative;
  z-index: 1;
}

.error-stage .section-eyebrow {
  margin-bottom: 1.5rem;
}

.error-headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.error-sub {
  font-family: 'Fraunces', var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.4;
  margin: 0 0 2.5rem;
}

/* === Responsive === */
@media (max-width: 640px) {
  .hero { padding: 5rem 1.25rem 3.5rem; }
  .profile-photo-frame { width: 150px; height: 150px; }
  .hero-name { margin: 2rem 0 1.5rem; }
  .section { padding: 4rem 1.25rem; }
  .section[data-number]::before { font-size: 7rem; top: 2rem; right: 0.75rem; }
  .reading-header,
  .reading-footer { padding: 0.9rem 1.25rem; }
  .reading-content { padding: 7rem 1.25rem; }
  .tech-strip { margin: 2.5rem 0; padding: 3rem 0; }
  .doc-embed { min-height: 66vh; }
}
