/* ===== Tokens (Catppuccin Latte) ===== */
:root {
  --bg: #eff1f5;          /* base */
  --bg-soft: #ffffff;     /* cards */
  --bg-tinted: #e6e9ef;   /* mantle */
  --bg-elev: #ccd0da;     /* surface0 */
  --text: #4c4f69;        /* text */
  --muted: #6c6f85;       /* subtext0 */
  --accent: #179299;      /* teal */
  --accent-soft: #209fb5; /* sapphire */
  --line: rgba(76, 79, 105, 0.16);
  --dark-bg: #1e1e2e;     /* mocha base */
  --dark-text: #cdd6f4;   /* mocha text */
  --dark-accent: #94e2d5; /* mocha teal */
  --dark-line: rgba(205, 214, 244, 0.28);
  --max: 1200px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --font-display: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
em { font-style: italic; }

::selection { background: var(--accent); color: var(--bg); }

/* ===== Layout ===== */
.container { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ===== Nav ===== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: rgba(239, 241, 245, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 1.5rem;
}
.brand { display: flex; align-items: baseline; gap: .4rem; font-family: var(--font-display); }
.brand__name { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand__divider { color: var(--accent); }
.brand__tag { font-size: .8rem; color: var(--muted); letter-spacing: 0.02em; }
.nav__links { display: flex; gap: 1.9rem; }
.nav__links a {
  font-size: .92rem; font-weight: 500; color: var(--muted);
  padding: .35rem 0; position: relative; transition: color .2s ease;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: .5rem; }
.nav__toggle span {
  display: block; width: 22px; height: 2px; background: var(--text);
  margin: 5px 0; transition: transform .25s ease;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { min-height: 100svh; display: flex; align-items: center; padding: 9rem 0 5rem; }
.hero__inner { text-align: center; }
.eyebrow {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 2rem;
}
.hero__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 7.5rem);
  line-height: 0.98; letter-spacing: -0.035em; margin-bottom: 2.25rem;
}
.hero__title em { font-size: 1.06em; color: var(--accent); }
.hero__sub {
  max-width: 620px; margin: 0 auto 2.75rem;
  font-size: clamp(1rem, 1.6vw, 1.2rem); color: var(--muted);
}
.hero__cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  font-size: .95rem; padding: .95rem 1.7rem; border-radius: 999px;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn--solid { background: var(--accent); color: var(--bg); }
.btn--solid:hover { background: var(--accent-soft); transform: translateY(-2px); }
.btn--ghost { border: 1px solid var(--text); color: var(--text); }
.btn--ghost:hover { background: var(--text); color: var(--bg); transform: translateY(-2px); }

/* ===== Marquee ===== */
.marquee {
  overflow: hidden; border-block: 1px solid var(--line);
  background: var(--bg); padding: 1.1rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex; align-items: center; gap: 2.4rem; width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee span {
  font-family: var(--font-mono); font-size: .95rem; letter-spacing: 0.02em;
  white-space: nowrap; color: var(--text);
}
.marquee i { color: var(--accent); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== Sections ===== */
.section { padding: clamp(5rem, 10vw, 8.5rem) 0; }
.section--tinted { background: var(--bg-tinted); }
.section--dark { background: var(--dark-bg); color: var(--dark-text); }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 3.5rem;
}
.section__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.03em; line-height: 1.05;
}
.section__title em { color: var(--accent); }
.section__title--dark em { color: var(--dark-accent); }
.section__link {
  font-family: var(--font-mono); font-size: .85rem; letter-spacing: 0.02em;
  border-bottom: 1px solid var(--accent); padding-bottom: 2px;
  transition: color .2s ease;
}
.section__link:hover { color: var(--accent); }

/* ===== Work grid ===== */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 18px;
  padding: 2rem; display: flex; flex-direction: column; gap: 1.1rem;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px -20px rgba(76, 79, 105, 0.25);
  border-color: rgba(76, 79, 105, 0.32);
}
.card__top { display: flex; justify-content: space-between; align-items: center; }
.card__index {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: 0.1em;
  color: var(--accent);
}
.card__arrow {
  font-size: 1.2rem; color: var(--accent); opacity: 0;
  transform: translate(-4px, 4px); transition: opacity .25s ease, transform .25s ease;
}
.card:hover .card__arrow { opacity: 1; transform: none; }
.card__title { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; }
.card__title a { position: relative; }
.card__title a::after {
  content: ""; position: absolute; left: 0; bottom: 2px; height: 2px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.card__title a:hover::after { transform: scaleX(1); }
.card__desc { color: var(--muted); flex: 1; }
.card__tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.card__tags li {
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: 0.02em;
  padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted);
}
.card__view {
  font-family: var(--font-mono); font-size: .85rem; letter-spacing: 0.02em;
  color: var(--accent); margin-top: auto; width: fit-content;
  border-bottom: 1px solid transparent; transition: border-color .2s ease;
}
.card__view:hover { border-bottom-color: var(--accent); }

/* ===== Currently building ===== */
.now { border-block: 1px solid var(--line); padding: clamp(4rem, 8vw, 6.5rem) 0; }
.now__inner { text-align: center; }
.now__label {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1.5rem;
}
.now__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 3.4rem); letter-spacing: -0.03em; line-height: 1.1;
  margin-bottom: 2.5rem;
}
.now__title em { color: var(--accent); }

/* ===== About ===== */
.about__grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 3rem; }
.about__body { display: flex; flex-direction: column; gap: 1.5rem; }
.about__body p { font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--text); line-height: 1.65; }
.about__note { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); letter-spacing: 0.04em; }

/* ===== Skills ===== */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.skill { background: var(--bg); padding: 2rem; display: flex; flex-direction: column; gap: .6rem; }
.skill h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.skill p { color: var(--muted); }

/* ===== Quote ===== */
.quote { padding: clamp(4rem, 8vw, 6.5rem) 0; text-align: center; }
.quote__text {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(1.8rem, 5vw, 3.4rem); line-height: 1.15;
  max-width: 760px; margin: 0 auto 1.25rem;
}
.quote__by { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }

/* ===== Contact (dark section) ===== */
.contact__links { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 3rem; max-width: 720px; }
.contact__link {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  letter-spacing: -0.01em; border-bottom: 1px solid var(--dark-line);
  padding-bottom: 1rem; transition: color .2s ease, border-color .2s ease;
  word-break: break-word;
}
.contact__link:hover { color: var(--dark-accent); border-color: var(--dark-accent); }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--line); padding: 2rem 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer p { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.footer__links { display: flex; gap: 1.4rem; }
.footer__links a { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); transition: color .2s ease; }
.footer__links a:hover { color: var(--text); }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .grid, .skills { grid-template-columns: 1fr; }
  .about__grid { grid-template-columns: 1fr; }
  .nav__links {
    position: fixed; top: 72px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--line); padding: 0 1.5rem;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links a { padding: 1rem 0; border-bottom: 1px solid var(--line); }
  .nav__toggle { display: block; }
  .brand__tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee__track { animation: none; }
}
