/* ═══════════════════════════════════════════
   CUSTOM PROPERTIES
   ═══════════════════════════════════════════ */
:root {
  --bg:        #0c0c0e;
  --bg-alt:    #111114;
  --surface:   #18181c;
  --border:    #232329;
  --border-h:  #2e2e36;

  --text:      #ececef;
  --text-2:    #a0a0ab;
  --text-3:    #65656f;

  --blue:      #58a6ff;
  --cyan:      #56d4dd;
  --orange:    #f0883e;
  --green:     #3fb950;

  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:      'JetBrains Mono', 'Fira Code', monospace;

  --ease:      cubic-bezier(.4, 0, .2, 1);
  --t:         0.25s var(--ease);
  --radius:    8px;
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

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

::selection { background: var(--blue); color: #000; }
a { color: var(--blue); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--cyan); }
ul { list-style: none; }

.container { width: min(100% - 48px, 960px); margin: 0 auto; }

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px); height: 64px;
  background: rgba(12, 12, 14, .88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t);
}

.nav--scrolled { border-bottom-color: var(--border); }

.nav__logo {
  font-family: var(--mono); font-size: 18px; font-weight: 600;
  color: var(--text) !important; letter-spacing: -.5px;
}

.nav__dot { color: var(--blue); }

.nav__links { display: flex; gap: 32px; }

.nav__links a {
  color: var(--text-3); font-size: 13px; font-weight: 500;
  letter-spacing: .2px; transition: color var(--t);
}

.nav__links a:hover { color: var(--text); }

.nav__toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}

.nav__toggle span {
  display: block; width: 20px; height: 1.5px;
  background: var(--text); transition: var(--t);
}

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #141420, var(--bg));
}

.hero__inner { text-align: center; padding: 100px 24px 80px; }

.hero__label {
  font-family: var(--mono); font-size: 12px; color: var(--blue);
  letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: 28px;
}

.hero__title {
  font-size: clamp(48px, 9vw, 88px); font-weight: 700;
  line-height: 1.05; letter-spacing: -2px; margin-bottom: 28px;
}

.hero__sub {
  color: var(--text-2); font-size: 17px; max-width: 540px;
  margin: 0 auto; line-height: 1.75;
}

.hero__sub--detail {
  color: var(--text-3); font-family: var(--mono); font-size: 13px;
  margin-top: 10px; letter-spacing: .5px;
}

.hero__actions {
  display: flex; gap: 12px; justify-content: center;
  flex-wrap: wrap; margin: 40px 0 32px;
}

.hero__links { display: flex; gap: 24px; justify-content: center; }

.hero__links a {
  color: var(--text-3); font-size: 13px; font-weight: 500;
  transition: color var(--t);
}

.hero__links a:hover { color: var(--blue); }

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 24px; border-radius: var(--radius);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  letter-spacing: .2px; transition: all var(--t); cursor: pointer;
  border: none;
}

.btn--primary { background: var(--blue); color: #000; }
.btn--primary:hover { background: var(--cyan); color: #000; }

.btn--ghost {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-2);
}

.btn--ghost:hover { border-color: var(--text-3); color: var(--text); }

/* ═══════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════ */
.section { padding: 88px 0; }
.section--alt { background: var(--bg-alt); }

.section__label {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  color: var(--blue); letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 12px;
}

.section__title {
  font-size: clamp(28px, 5vw, 40px); font-weight: 700;
  letter-spacing: -.5px; margin-bottom: 16px;
}

.section__desc {
  color: var(--text-2); font-size: 15px; max-width: 520px;
  margin-bottom: 44px; line-height: 1.7;
}

/* ═══════════════════════════════════════════
   ABOUT
   ═══════════════════════════════════════════ */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: start; }

.about__text p { color: var(--text-2); font-size: 15px; line-height: 1.8; }
.about__text p + p { margin-top: 16px; }

.about__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.about__meta div {
  padding: 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}

.about__meta dt {
  font-family: var(--mono); font-size: 10px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px;
}

.about__meta dd { color: var(--text-2); font-size: 13px; }

/* ═══════════════════════════════════════════
   SKILLS
   ═══════════════════════════════════════════ */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.skills__group {
  padding: 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color var(--t);
}

.skills__group:hover { border-color: var(--border-h); }

.skills__group h3 {
  font-size: 14px; font-weight: 600; margin-bottom: 14px; color: var(--text);
}

.skills__tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-block; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--mono); font-size: 11px; color: var(--text-2);
  background: var(--bg-alt); transition: border-color var(--t), color var(--t);
}

.tag:hover { border-color: var(--text-3); color: var(--text); }

.tag--blue { border-color: rgba(88, 166, 255, .2); color: var(--blue); }
.tag--blue:hover { border-color: var(--blue); }

.tag--orange { border-color: rgba(240, 136, 62, .2); color: var(--orange); }
.tag--orange:hover { border-color: var(--orange); }

.tag--teal { border-color: rgba(86, 212, 221, .2); color: var(--cyan); }
.tag--teal:hover { border-color: var(--cyan); }

/* ═══════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════ */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.project {
  display: flex; flex-direction: column; padding: 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); transition: border-color var(--t), transform var(--t);
  text-decoration: none; color: inherit;
}

.project:hover { border-color: var(--border-h); transform: translateY(-2px); }

.project__top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}

.project__name { font-size: 15px; font-weight: 600; color: var(--text); }

.project__arrow { color: var(--text-3); font-size: 13px; transition: color var(--t); }
.project:hover .project__arrow { color: var(--blue); }

.project__desc {
  color: var(--text-2); font-size: 13px; line-height: 1.65;
  flex: 1; margin-bottom: 16px;
}

.project__meta {
  display: flex; gap: 12px; font-family: var(--mono);
  font-size: 11px; color: var(--text-3);
}

.project__meta span { display: flex; align-items: center; gap: 4px; }

.lang-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--text-3);
}

.lang-dot[data-lang="C"]          { background: #6b7280; }
.lang-dot[data-lang="Rust"]       { background: #dea584; }
.lang-dot[data-lang="Go"]         { background: #00add8; }
.lang-dot[data-lang="JavaScript"] { background: #f1e05a; }
.lang-dot[data-lang="TypeScript"] { background: #3178c6; }
.lang-dot[data-lang="Python"]     { background: #3572a5; }
.lang-dot[data-lang="Shell"]      { background: #89e051; }
.lang-dot[data-lang="HTML"]       { background: #e34c26; }
.lang-dot[data-lang="CSS"]        { background: #563d7c; }
.lang-dot[data-lang="Dockerfile"] { background: #384d54; }

/* ═══════════════════════════════════════════
   TIMELINE / EXPERIENCE
   ═══════════════════════════════════════════ */
.timeline { position: relative; padding-left: 28px; }

.timeline::before {
  content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1px; background: var(--border);
}

.timeline__item { position: relative; padding-bottom: 36px; }
.timeline__item:last-child { padding-bottom: 0; }

.timeline__dot {
  position: absolute; left: -28px; top: 6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg-alt); border: 2px solid var(--blue);
}

.timeline__content {
  padding: 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color var(--t);
}

.timeline__content:hover { border-color: var(--border-h); }

.timeline__header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}

.timeline__header h3 { font-size: 15px; font-weight: 600; }

.timeline__date {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  letter-spacing: .3px;
}

.timeline__desc { color: var(--text-2); font-size: 13px; line-height: 1.7; margin-bottom: 12px; }

.timeline__tags { display: flex; flex-wrap: wrap; gap: 6px; }

.timeline__tags a.tag { color: inherit; }

/* ═══════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════ */
.contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.contact__card {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 32px 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color var(--t); color: inherit !important;
}

.contact__card:hover { border-color: var(--border-h); }

.contact__icon { font-size: 20px; margin-bottom: 10px; opacity: .5; }

.contact__label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }

.contact__value { font-family: var(--mono); font-size: 12px; color: var(--text-3); }

.contact__hint {
  font-size: 11px; color: var(--text-3); margin-top: 6px;
  opacity: 0; transition: opacity var(--t);
}

#emailCard:hover .contact__hint { opacity: 1; }
#emailCard.copied .contact__hint { opacity: 1; color: var(--green); }

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.footer {
  padding: 24px 0; border-top: 1px solid var(--border);
  color: var(--text-3); font-size: 12px;
}

.footer__inner {
  display: flex; align-items: center; justify-content: space-between;
}

/* ═══════════════════════════════════════════
   SCROLL REVEAL
   ═══════════════════════════════════════════ */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity .45s ease, transform .45s ease;
}

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

/* ═══════════════════════════════════════════
   RESPONSIVE — 1024px
   ═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .container { width: min(100% - 48px, 720px); }
  .about { gap: 40px; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — 768px
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .container { width: min(100% - 32px, 100%); }
  .section { padding: 64px 0; }

  .nav__links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: rgba(12, 12, 14, .97);
    backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }

  .nav__links.open { display: flex; }
  .nav__links a { padding: 11px 20px; border-bottom: 1px solid var(--border); }
  .nav__toggle { display: flex; }

  .hero__inner { padding: 80px 20px 60px; }
  .hero__title { font-size: clamp(40px, 12vw, 60px); }

  .about { grid-template-columns: 1fr; gap: 32px; }
  .skills { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }

  .timeline__header { flex-direction: column; gap: 4px; }

  .footer__inner { flex-direction: column; gap: 8px; text-align: center; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — 480px
   ═══════════════════════════════════════════ */
@media (max-width: 480px) {
  .section { padding: 52px 0; }
  .section__label { font-size: 10px; letter-spacing: 2px; }
  .section__title { font-size: clamp(24px, 7vw, 32px); }

  .hero__sub { font-size: 15px; }
  .hero__actions { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 260px; justify-content: center; }

  .about__meta { grid-template-columns: 1fr; }

  .contact__card { padding: 24px 16px; }

  .timeline { padding-left: 20px; }
  .timeline__dot { left: -20px; width: 9px; height: 9px; }
}

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