
:root {
  /* dark mode (default) */
  --bg: #0e0f13;
  --ink: #eeeeea;
  --muted: #9a9aa0;
  --soft: #6a6a70;
  --line: #26272d;
  --accent: #6b8aff;
  --hover: #93a9ff;
  --card: #14151a;
}

:root.light {
  --bg: #fafaf7;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --soft: #999999;
  --line: #e5e5e0;
  --accent: #3d5aff;
  --hover: #6b7dff;
  --card: #ffffff;
}

/* ============================================
   DOMAIN EXPANSION OPENER (minimal)
   ============================================ */
.domain {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: domainExit 1.4s cubic-bezier(0.77, 0, 0.175, 1) forwards;
  animation-delay: 1.8s;
}

.domain-ring {
  position: absolute;
  width: 80px; height: 80px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
}
.domain-ring.r1 { animation: ringExpand 1.8s ease-out 0s forwards; }
.domain-ring.r2 { animation: ringExpand 1.8s ease-out 0.25s forwards; opacity: 0.5; }
.domain-ring.r3 { animation: ringExpand 1.8s ease-out 0.5s forwards; opacity: 0.3; }

@keyframes ringExpand {
  0% { opacity: 0; transform: scale(0.4); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: scale(20); }
}

.domain-text {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.6rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0;
  animation: domainText 1.8s ease-in-out forwards;
}
@keyframes domainText {
  0% { opacity: 0; letter-spacing: 0.3em; }
  30%, 70% { opacity: 1; letter-spacing: 0.1em; }
  100% { opacity: 0; letter-spacing: 0.02em; }
}

@keyframes domainExit {
  0% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

/* infinity symbol next to name */
.infinity {
  display: inline-block;
  color: var(--accent);
  font-family: 'Fraunces', serif;
  font-weight: 300;
  margin-right: 0.2em;
  animation: floaty 4s ease-in-out infinite;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}
.logo:hover .infinity {
  transform: rotate(180deg);
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s ease, color 0.4s ease;
  position: relative;
  overflow-x: hidden;
}

/* soft drifting ambient background */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* faint dotted grid overlay */
.ambient::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--ink) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.025;
  animation: gridDrift 40s linear infinite;
}
:root.light .ambient::before { opacity: 0.04; }

@keyframes gridDrift {
  from { transform: translate(0, 0); }
  to { transform: translate(38px, 38px); }
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  will-change: transform;
}

:root.light .blob { opacity: 0.2; }

.blob-1 {
  width: 520px;
  height: 520px;
  background: var(--accent);
  top: -200px;
  left: -150px;
  animation: drift1 28s ease-in-out infinite;
}
.blob-2 {
  width: 420px;
  height: 420px;
  background: var(--accent);
  bottom: -150px;
  right: -100px;
  opacity: 0.2;
  animation: drift2 34s ease-in-out infinite;
}
:root.light .blob-2 { opacity: 0.12; }

.blob-3 {
  width: 340px;
  height: 340px;
  background: var(--accent);
  top: 40%;
  left: 55%;
  opacity: 0.12;
  animation: drift3 44s ease-in-out infinite;
}
:root.light .blob-3 { opacity: 0.08; }

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, 40px) scale(1.1); }
  66% { transform: translate(-40px, 80px) scale(0.95); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-100px, -60px) scale(1.15); }
}
@keyframes drift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-60px, 100px) scale(1.08); }
  75% { transform: translate(90px, -50px) scale(0.92); }
}

/* drifting stars (small background scatter) */
.star {
  position: absolute;
  width: 1px;
  height: 1px;
  background: var(--ink);
  border-radius: 50%;
  opacity: 0.25;
  will-change: transform, opacity;
}
:root.light .star { opacity: 0.35; }
.star.sm { width: 1px; height: 1px; }
.star.lg { width: 2px; height: 2px; }

@keyframes starDrift {
  0%, 100% {
    transform: translate(0, 0);
    opacity: var(--star-opacity, 0.25);
  }
  50% {
    transform: translate(var(--dx, 20px), var(--dy, -15px));
    opacity: calc(var(--star-opacity, 0.25) * 1.8);
  }
}

/* constellations */
.constellation {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  animation: constFade 2s ease-out forwards, constDrift var(--drift-dur, 40s) ease-in-out infinite;
}
@keyframes constFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes constDrift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(var(--dx1, 15px), var(--dy1, -10px)); }
  50% { transform: translate(var(--dx2, -10px), var(--dy2, 12px)); }
  75% { transform: translate(var(--dx3, 8px), var(--dy3, -5px)); }
}

.const-star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--ink);
  border-radius: 50%;
  opacity: 0.55;
  box-shadow: 0 0 6px currentColor;
  color: var(--accent);
  animation: twinkle 4s ease-in-out infinite;
}
.const-star.bright {
  width: 4px;
  height: 4px;
  opacity: 0.75;
}
.const-star.faint {
  width: 2px;
  height: 2px;
  opacity: 0.4;
}
@keyframes twinkle {
  0%, 100% { opacity: var(--tw, 0.55); }
  50% { opacity: calc(var(--tw, 0.55) * 0.5); }
}

.const-svg {
  position: absolute;
  inset: 0;
  overflow: visible;
}
.const-line {
  stroke: var(--accent);
  stroke-width: 0.5;
  fill: none;
  opacity: 0.18;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: lineDraw 3s ease-out forwards, linePulse 6s ease-in-out 3s infinite;
}
@keyframes lineDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes linePulse {
  0%, 100% { opacity: 0.18; }
  50% { opacity: 0.32; }
}

/* shooting stars — rare streaks */
.shooting-star {
  position: absolute;
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transform: rotate(-25deg);
  animation: shoot 8s ease-in infinite;
}
.shooting-star.s1 {
  top: 15%;
  left: -10%;
  animation-delay: 4s;
  animation-duration: 12s;
}
.shooting-star.s2 {
  top: 55%;
  left: -10%;
  animation-delay: 18s;
  animation-duration: 15s;
}

@keyframes shoot {
  0% { transform: translate(0, 0) rotate(-25deg); opacity: 0; }
  2% { opacity: 0.7; }
  8% { opacity: 0.7; }
  10% { transform: translate(120vw, -40vh) rotate(-25deg); opacity: 0; }
  100% { transform: translate(120vw, -40vh) rotate(-25deg); opacity: 0; }
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s ease, color 0.2s ease;
}
a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
}

main {
  opacity: 0;
  animation: fadeIn 0.9s ease-out 3s forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  border: none;
  cursor: pointer;
}
.logo .dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  font-size: 0.9rem;
  align-items: center;
}
.nav-links a {
  color: var(--muted);
  border: none;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--accent); }

.hero { margin-bottom: 5rem; }

h1 {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}
h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}

/* blinking cursor after headline */
.cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: var(--accent);
  margin-left: 0.12em;
  vertical-align: -0.08em;
  animation: blink 1.1s steps(1) infinite;
  opacity: 0;
  animation-delay: 3.2s;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.hero p {
  color: var(--muted);
  max-width: 560px;
  font-size: 1rem;
  line-height: 1.75;
}
.hero p a {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

/* rotating word */
.rotator {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
  color: var(--accent);
  font-style: italic;
  font-family: 'Fraunces', serif;
  white-space: nowrap;
}
.rotator .sizer {
  visibility: hidden;
  white-space: nowrap;
}
.rotator span.word {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  animation: rotateWord 14s ease-in-out infinite;
}
.rotator span.word:nth-of-type(1) { animation-delay: 0s; }
.rotator span.word:nth-of-type(2) { animation-delay: 3.5s; }
.rotator span.word:nth-of-type(3) { animation-delay: 7s; }
.rotator span.word:nth-of-type(4) { animation-delay: 10.5s; }

@keyframes rotateWord {
  0% { opacity: 0; transform: translateY(6px); }
  3%, 22% { opacity: 1; transform: translateY(0); }
  25%, 100% { opacity: 0; transform: translateY(-6px); }
}

section { margin-bottom: 4.5rem; }

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--soft);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-label::after {
  content: '';
  flex: 0 0 0;
  height: 1px;
  background: var(--line);
  transition: flex-basis 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}
section.visible .section-label::after {
  flex-basis: 60px;
}

.entry {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.35s cubic-bezier(0.77, 0, 0.175, 1);
}
.entry:last-child { border-bottom: none; }
.entry:hover {
  padding-left: 0.5rem;
}
.entry:hover .entry-meta {
  color: var(--accent);
}
.entry-meta {
  transition: color 0.3s ease;
}

.entry-title {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.35rem;
  color: var(--ink);
}
.entry-title a {
  border-bottom: 1px solid var(--line);
}

.entry-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--soft);
  letter-spacing: 0.01em;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  /* subtle dividers instead of opaque background */
}
.tool-card {
  padding: 1.75rem 1.5rem;
  background: transparent;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: toolBob 6s ease-in-out infinite;
}
/* remove right border from last column, bottom border from last row */
.tool-card:nth-child(2n) { border-right: none; }
.tool-card:nth-last-child(-n+2) { border-bottom: none; }
/* staggered gentle floating so they don't all bob in sync */
.tool-card:nth-child(1) { animation-delay: 0s; }
.tool-card:nth-child(2) { animation-delay: 0.6s; }
.tool-card:nth-child(3) { animation-delay: 1.2s; }
.tool-card:nth-child(4) { animation-delay: 1.8s; }
.tool-card:nth-child(5) { animation-delay: 2.4s; }
.tool-card:nth-child(6) { animation-delay: 3s; }

@keyframes toolBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* traits — soft skills row */
.traits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}
.trait {
  padding: 1rem 0.25rem;
  text-align: left;
  transition: transform 0.35s cubic-bezier(0.77, 0, 0.175, 1);
}
.trait:hover {
  transform: translateY(-3px);
}
.trait-glyph {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-style: italic;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  display: inline-block;
  animation: traitPulse 5s ease-in-out infinite;
}
.trait:nth-child(2) .trait-glyph { animation-delay: 0.5s; }
.trait:nth-child(3) .trait-glyph { animation-delay: 1s; }
.trait:nth-child(4) .trait-glyph { animation-delay: 1.5s; }
.trait:nth-child(5) .trait-glyph { animation-delay: 2s; }
.trait:nth-child(6) .trait-glyph { animation-delay: 2.5s; }
.trait:nth-child(7) .trait-glyph { animation-delay: 3s; }
@keyframes traitPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}
.trait-name {
  font-family: 'Fraunces', serif;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.trait-desc {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--soft);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.tool-icon {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-style: italic;
  display: inline-block;
}

.tool-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.tool-card p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
  line-height: 1.55;
}

.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.tool-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--soft);
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.15rem 0.5rem;
  transition: all 0.2s ease;
}
.tool-tag:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* /now section */
.now-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.now-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0.4rem 0;
  transition: padding-left 0.3s ease;
}
.now-item:hover {
  padding-left: 0.4rem;
}
.now-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  min-width: 80px;
  flex-shrink: 0;
}
.now-text {
  color: var(--muted);
  line-height: 1.5;
}
.now-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--soft);
  letter-spacing: 0.05em;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* custom cursor */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, opacity 0.2s ease;
  mix-blend-mode: difference;
  opacity: 0;
}
.cursor-dot.active {
  opacity: 0.9;
}
.cursor-dot.hover {
  width: 22px;
  height: 22px;
  background: var(--accent);
  opacity: 0.5;
}

/* hide custom cursor on touch devices */
@media (hover: none) {
  .cursor-dot { display: none; }
}
.contact-intro {
  color: var(--muted);
  max-width: 560px;
}

.contact-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  margin-top: 1.5rem;
}
.contact-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  border-left: none;
  border-right: none;
  border-top: none;
  color: var(--ink);
  transition: padding-left 0.3s ease, color 0.3s ease;
}
.contact-item:hover {
  padding-left: 0.5rem;
  color: var(--accent);
}
.contact-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--soft);
}
.contact-item:hover .contact-label { color: var(--accent); }
.contact-value {
  font-size: 0.95rem;
}

footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--soft);
}
.social {
  display: flex;
  gap: 1.25rem;
}
.social a {
  color: var(--soft);
  border: none;
}
.social a:hover { color: var(--accent); }

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* theme toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  padding: 0;
  margin-left: 0.5rem;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(15deg);
}
.theme-toggle svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
:root.light .theme-toggle .sun { display: block; }
:root.light .theme-toggle .moon { display: none; }

@media (max-width: 600px) {
  .container { padding: 3rem 1.5rem 4rem; }
  nav { margin-bottom: 3.5rem; }
  h1 { font-size: 1.65rem; }
  section { margin-bottom: 3.5rem; }
  .tools-grid { grid-template-columns: 1fr; }
  /* in single-column, every card gets only a bottom border, last card none */
  .tool-card { border-right: none; border-bottom: 1px solid var(--line); }
  .tool-card:last-child { border-bottom: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .domain { display: none; }
}