/* All design for the portfolio. Colors and fonts live in the :root
   custom properties below. */

:root {
  --bg: #0A0E16;
  --surface: #111726;
  --surface-2: #0D1320;
  --line: rgba(233,237,243,.08);
  --line-strong: rgba(233,237,243,.14);
  --text: #E9EDF3;
  --muted: #96A0B3;
  --faint: #5F6A7E;
  --accent: #4FD1C5;
  --accent-dim: #2E9E93;
  --accent-soft: rgba(79,209,197,.12);
  --steel: #7FA6C9;
  --radius: 10px;
  --font-display: "Bricolage Grotesque",system-ui,sans-serif;
  --font-body: "IBM Plex Sans",system-ui,sans-serif;
  --font-mono: "IBM Plex Mono",ui-monospace,monospace;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: #0A0E16;
}

a {
  color: var(--text);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px;
}

noscript {
  display: block;
  padding: 40px 24px;
  font-family: var(--font-mono);
  color: var(--muted);
}

/* ---------- top nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,14,22,.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-family: var(--font-mono);
  font-size: .9rem;
  color: var(--muted);
}

.nav-brand b {
  color: var(--text);
  font-weight: 500;
}

.nav-brand .tick {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 26px;
  list-style: none;
}

.nav-links a {
  font-size: .86rem;
  color: var(--muted);
  transition: color .18s;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
}

/* ---------- hero ---------- */

.hero {
  padding: 88px 0 96px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(600px 320px at 82% 18%, rgba(79,209,197,.07), transparent 65%), radial-gradient(520px 300px at 8% 90%, rgba(127,166,201,.05), transparent 65%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
  position: relative;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--accent);
  margin-bottom: 18px;
  display: block;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem,6vw,4.2rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.02em;
  margin-bottom: 22px;
}

h1 .surname {
  color: var(--muted);
  font-weight: 600;
}

.hero-lede {
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 34px;
  font-size: 1.06rem;
}

.hero-lede strong {
  color: var(--text);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: .85rem;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: transparent;
  transition: border-color .18s,background .18s,transform .18s;
}

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

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0A0E16;
  font-weight: 500;
}

.btn-primary:hover {
  background: #72DED4;
  border-color: #72DED4;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

/* ---------- signature: query card ---------- */

.query-card {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.8);
  font-family: var(--font-mono);
  font-size: .82rem;
  overflow: hidden;
}

.query-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: .74rem;
}

.query-bar .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.query-bar .dot:first-child {
  background: rgba(79,209,197,.55);
}

.query-bar span:last-child {
  margin-left: auto;
}

.query-body {
  padding: 20px 20px 8px;
  min-height: 132px;
  white-space: pre-wrap;
  line-height: 1.75;
  color: var(--muted);
}

.query-body .kw {
  color: var(--accent);
}

.query-body .str {
  color: var(--steel);
}

.caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: var(--accent);
  vertical-align: -3px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.query-result {
  padding: 0 20px 18px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .5s ease,transform .5s ease;
}

.query-result.show {
  opacity: 1;
  transform: none;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}

.result-table th {
  text-align: left;
  color: var(--faint);
  font-weight: 400;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-strong);
}

.result-table td {
  padding: 9px 10px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.result-table td:last-child {
  color: var(--steel);
}

.result-meta {
  color: var(--faint);
  font-size: .72rem;
  padding-top: 10px;
}

.result-meta em {
  color: var(--accent);
  font-style: normal;
}

/* ---------- sections ---------- */

section {
  padding: 84px 0;
  border-top: 1px solid var(--line);
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: 44px;
}

.sec-label {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--accent);
  white-space: nowrap;
}

.sec-label::before {
  content: "-- ";
}

.sec-rule {
  height: 1px;
  background: var(--line);
  flex: 1;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem,3vw,2rem);
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 44px;
  margin-top: -30px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease,transform .6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}

.about-grid p {
  color: var(--muted);
  margin-bottom: 18px;
}

.about-grid p strong {
  color: var(--text);
  font-weight: 500;
}

.facts {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px 22px;
}

.facts .fact {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.facts .fact:last-child {
  border-bottom: 0;
}

.facts dt {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--faint);
}

.facts dd {
  font-size: .88rem;
  text-align: right;
  color: var(--text);
}

/* ---------- experience timeline ---------- */

.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line-strong);
}

.t-item {
  position: relative;
  padding-bottom: 52px;
}

.t-item:last-child {
  padding-bottom: 0;
}

.t-item::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.t-date {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent);
  margin-bottom: 6px;
}

.t-role {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.t-org {
  color: var(--muted);
  font-size: .92rem;
  margin-bottom: 16px;
}

.t-org a {
  color: var(--steel);
  border-bottom: 1px solid transparent;
  transition: border-color .18s;
}

.t-org a:hover {
  border-color: var(--steel);
}

.t-list {
  list-style: none;
  color: var(--muted);
  font-size: .95rem;
}

.t-list li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 9px;
}

.t-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent-dim);
  font-size: .8rem;
  top: 2px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--steel);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 12px;
}

/* ---------- projects ---------- */

.proj-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 20px;
}

.proj {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color .2s,transform .2s,background .2s;
}

a.proj:hover {
  border-color: rgba(79,209,197,.5);
  transform: translateY(-3px);
  background: #131a2b;
}

.proj-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.proj h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.3;
}

.proj-top svg {
  width: 17px;
  height: 17px;
  color: var(--faint);
  flex: none;
  margin-top: 3px;
  transition: color .2s;
}

a.proj:hover .proj-top svg {
  color: var(--accent);
}

.proj p {
  color: var(--muted);
  font-size: .9rem;
  flex: 1;
}

.proj .tags {
  margin-top: 2px;
}

/* ---------- activity: GitHub + LeetCode ---------- */

.activity-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--accent);
  letter-spacing: .03em;
}

.panel-link {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--faint);
  transition: color .18s;
}

a.panel-link:hover {
  color: var(--accent);
}

.panel-note {
  color: var(--faint);
  font-size: .82rem;
  font-family: var(--font-mono);
  margin: auto 0;
  text-align: center;
  padding: 24px 8px;
  line-height: 1.8;
}

.panel-note a {
  color: var(--steel);
}

.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  min-height: 27px;
}

.chip {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}

.chip b {
  color: var(--text);
  font-weight: 500;
}

.cal-scroll {
  overflow: hidden;
  padding-bottom: 6px;
}

.cal {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7,10px);
  gap: 3px;
  width: max-content;
  min-height: 88px;
}

.cal i,
.cal-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--line);
  display: inline-block;
}

.cal i.cal-pad {
  background: transparent;
}

.cal i.l1,
.cal-legend i.l1 {
  background: rgba(79,209,197,.28);
}

.cal i.l2,
.cal-legend i.l2 {
  background: rgba(79,209,197,.5);
}

.cal i.l3,
.cal-legend i.l3 {
  background: rgba(79,209,197,.75);
}

.cal i.l4,
.cal-legend i.l4 {
  background: var(--accent);
}

.cal-caption {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--faint);
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cal-caption b {
  color: var(--text);
  font-weight: 500;
}

.cal-caption a {
  color: var(--steel);
}

.cal-legend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.lc-total {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.lc-total small {
  font-size: .9rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-weight: 400;
}

.lc-sub {
  color: var(--faint);
  font-size: .76rem;
  font-family: var(--font-mono);
  margin-bottom: 22px;
}

.lc-row {
  margin-bottom: 14px;
}

.lc-row:last-child {
  margin-bottom: 0;
}

.lc-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.lc-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.lc-fill {
  height: 100%;
  border-radius: 99px;
  width: 0;
  transition: width .9s ease;
}

.lc-easy .lc-fill {
  background: var(--steel);
}

.lc-medium .lc-fill {
  background: #E5A84B;
}

.lc-hard .lc-fill {
  background: #D0716B;
}

/* ---------- skills ---------- */

.skill-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 20px;
}

.skill-col {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 24px;
}

.skill-col h3 {
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: .03em;
}

.skill-col ul {
  list-style: none;
}

.skill-col li {
  color: var(--muted);
  font-size: .9rem;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.skill-col li:last-child {
  border-bottom: 0;
}

/* ---------- education & certificates ---------- */

.edu-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 56px;
  align-items: start;
}

.col-label {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--faint);
  margin-bottom: 24px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.cert {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.cert:last-child {
  border-bottom: 0;
}

.cert-name {
  font-size: .94rem;
  font-weight: 500;
}

.cert-org {
  color: var(--muted);
  font-size: .83rem;
  margin-top: 2px;
}

.cert-date {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 3px;
}

/* ---------- contact ---------- */

.contact {
  text-align: center;
  padding: 110px 0 100px;
}

.contact .sec-label {
  display: block;
  margin-bottom: 22px;
}

.contact h2 {
  margin: 0 0 18px;
}

.contact p {
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto 36px;
}

.contact-mail {
  font-family: var(--font-display);
  font-size: clamp(1.2rem,3.4vw,1.9rem);
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
  transition: color .2s;
}

.contact-mail:hover {
  color: var(--accent);
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 44px;
  flex-wrap: wrap;
}

footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: .74rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- responsive ---------- */

@media (max-width: 920px) {
  .hero {
    padding: 64px 0 72px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .about-grid,
  .edu-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .activity-grid {
    grid-template-columns: 1fr;
  }
  .proj-grid {
    grid-template-columns: 1fr;
  }
  .skill-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

@media (max-width: 620px) {
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: block;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: .78rem;
    padding: 7px 12px;
    cursor: pointer;
  }
  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10,14,22,.97);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px;
  }
  .nav.open .nav-links a {
    display: block;
    padding: 11px 0;
  }
  .skill-grid {
    grid-template-columns: 1fr;
  }
  section {
    padding: 64px 0;
  }
}
