/* ======================== VARIABLES ======================== */
:root {
  --bg:           #080c14;
  --bg-2:         #0c1220;
  --bg-card:      #0d1624;
  --bg-card-h:    #111e30;

  --accent:       #00d4ff;
  --accent-dim:   rgba(0, 212, 255, 0.07);
  --accent-mid:   rgba(0, 212, 255, 0.15);
  --accent-glow:  rgba(0, 212, 255, 0.28);

  --text:         #dce8f8;
  --text-mid:     #8da4c0;
  --text-muted:   #748395;

  --border:       rgba(255, 255, 255, 0.05);
  --border-h:     rgba(0, 212, 255, 0.22);

  --nav-h:        68px;

  --f-display:    'Syne', sans-serif;
  --f-body:       'DM Sans', sans-serif;
  --f-mono:       'JetBrains Mono', monospace;

  --ease:         cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a   { color: inherit; }

/* ======================== TYPE UTILS ======================== */
h1, h2, h3 { font-family: var(--f-display); line-height: 1.1; }
.mono   { font-family: var(--f-mono); }
.accent { color: var(--accent); }

/* ======================== LAYOUT UTILS ======================== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
}

section { padding: 7rem 0; }

.section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 700;
  margin-bottom: 3.5rem;
  color: var(--text);
}

.section-num {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 400;
  flex-shrink: 0;
}

.heading-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-h), transparent);
  min-width: 50px;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.reveal.active          { opacity: 1; transform: translateY(0); }
.reveal-delay           { transition-delay: 0.18s; }

/* ======================== NAVIGATION ======================== */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  z-index: 1000;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}

#nav.scrolled {
  background: rgba(8, 12, 20, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 1px;
}
.logo-bracket { color: var(--accent); font-weight: 400; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  align-items: center;
}

.nav-link {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s;
}
.nav-num { color: var(--accent); font-size: 0.7rem; }
.nav-link:hover { color: var(--text); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4.5px, -4.5px); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.97);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
}
.mobile-menu.open { display: flex; }

.mobile-menu ul {
  list-style: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
.mobile-link {
  font-family: var(--f-display);
  font-size: 2.4rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: color 0.2s;
}
.mobile-link span {
  font-family: var(--f-mono);
  font-size: 0.85rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.2rem;
}
.mobile-link:hover { color: var(--accent); }

/* ======================== SOCIAL RAIL ======================== */
.social-rail {
  position: fixed;
  bottom: 0;
  left: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  z-index: 100;
}
.social-icon {
  color: var(--text-muted);
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
}
.social-icon:hover { color: var(--accent); transform: translateY(-3px); }
.rail-line {
  width: 1px;
  height: 90px;
  background: var(--text-muted);
  opacity: 0.25;
}

/* ======================== HERO ======================== */
#home {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-left: max(7rem, 9vw);
  overflow: hidden;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.032) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: radial-gradient(ellipse 75% 75% at 50% 45%, black 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 45%, black 0%, transparent 100%);
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  top: -15%;
  left: -5%;
  width: 55%;
  height: 75%;
  background: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.045) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  animation: heroIn 0.9s var(--ease) both;
}

.hero-label {
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0.75;
  letter-spacing: 0.5px;
}

@keyframes blink { 50% { opacity: 0; } }
.blink { animation: blink 1.1s step-end infinite; }

.hero-name {
  font-size: clamp(3.5rem, 8.5vw, 7.5rem);
  font-weight: 800;
  letter-spacing: -3px;
  line-height: 0.93;
  margin-bottom: 1.5rem;
}
.name-line   { display: block; }
.name-indent { padding-left: 0.12em; }
.accent-dot  { color: var(--accent); }

.hero-role {
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  color: var(--text-mid);
  margin-bottom: 1.75rem;
  min-height: 1.8rem;
}
.role-prefix  { color: var(--text-muted); }
.typed-target { color: var(--accent); }

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 2.5rem;
  max-width: 460px;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 13px 34px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--f-display);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 3px;
  letter-spacing: 0.4px;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn-primary:hover {
  background: #2ddeff;
  box-shadow: 0 0 32px rgba(0, 212, 255, 0.38);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 12px 34px;
  background: transparent;
  color: var(--text);
  font-family: var(--f-display);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-h);
  border-radius: 3px;
  letter-spacing: 0.4px;
  transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.1);
  transform: translateY(-2px);
}

.hero-corner {
  position: absolute;
  bottom: 3rem;
  right: 3rem;
  text-align: right;
  opacity: 0.2;
  pointer-events: none;
}
.corner-text {
  font-size: 0.68rem;
  color: var(--text-mid);
  line-height: 1.9;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ======================== ABOUT ======================== */
#about { background: var(--bg-2); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 5rem;
  align-items: center;
}

.about-text h2 { margin-bottom: 2rem; }

.about-text p {
  color: var(--text-mid);
  font-size: 0.98rem;
  line-height: 1.88;
  margin-bottom: 1.2rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  color: var(--accent);
  font-family: var(--f-mono);
  font-size: 0.82rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 0.2s, opacity 0.2s;
}
.contact-link:hover { border-color: var(--accent); opacity: 0.75; }

/* Profile photo */
.profile-photo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  box-shadow: 0 0 28px var(--accent-glow), 0 20px 50px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease);
}

.profile-photo:hover {
  transform: scale(1.04);
  box-shadow: 0 0 42px var(--accent-glow), 0 20px 50px rgba(0, 0, 0, 0.55);
}

/* Code card */
.code-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.code-card:hover {
  border-color: var(--border-h);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 255, 0.06);
}

.code-card-header {
  background: rgba(255, 255, 255, 0.028);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red    { background: #ff5f57; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #28c840; }
.code-card-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 0.4rem;
}

.code-card-body {
  padding: 1.5rem;
  font-size: 0.8rem;
  line-height: 2;
  white-space: pre;
  overflow-x: auto;
}
.c-bracket { color: var(--text); }
.c-key     { color: #79b8ff; }
.c-colon   { color: var(--text-muted); }
.c-str     { color: #9ecbff; }
.c-comma   { color: var(--text-muted); }
.c-accent  { color: var(--accent); }

/* ======================== SKILLS ======================== */
#skills { background: var(--bg); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.skill-group:hover {
  border-color: var(--border-h);
  box-shadow: 0 8px 40px rgba(0, 212, 255, 0.05);
}

.skill-group-title {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 11px;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.1);
  border-radius: 20px;
  font-size: 0.76rem;
  color: var(--text-mid);
  cursor: default;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
}
.tag:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.3);
  color: var(--text);
  transform: translateY(-1px);
}
.tag iconify-icon { font-size: 1rem; vertical-align: middle; }

/* ======================== PROJECTS ======================== */
#projects { background: var(--bg-2); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-h);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 212, 255, 0.07);
}
.project-card:hover::before { opacity: 1; }

.project-img {
  height: 185px;
  background-size: cover;
  background-position: center top;
  position: relative;
}
.project-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, var(--bg-card) 100%);
}

.card-radar       { background-image: url('images/trend-radar.png'); background-position: center top; }
.card-drawvaltine { background-image: url('images/drawvaltine.png'); background-position: center top; }
.card-settl       { background-image: url('images/settl.png'); background-position: center top; }

.project-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.7rem;
}

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

.project-folder {
  color: var(--accent);
  font-size: 1.45rem;
  opacity: 0.7;
}
.project-favicon {
  width: 1.45rem;
  height: 1.45rem;
  object-fit: contain;
  opacity: 0.85;
}

.project-links-inline { display: flex; gap: 0.9rem; }
.project-links-inline a {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
}
.project-links-inline a:hover { color: var(--accent); transform: translateY(-2px); }

.project-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.project-body p {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.75;
  flex: 1;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.project-stack { display: flex; align-items: center; gap: 0.55rem; }
.project-stack iconify-icon { font-size: 1.25rem; }

.tip {
  position: relative;
  display: inline-flex;
}
.tip::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, calc(-100% - 7px));
  background: var(--bg-card-h);
  color: var(--text);
  font-family: var(--f-mono);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-h);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s var(--ease);
}
.tip:hover::after {
  opacity: 1;
}

.project-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* ======================== FOOTER ======================== */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}
.footer-social a {
  color: var(--text-muted);
  font-size: 1.05rem;
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
}
.footer-social a:hover { color: var(--accent); transform: translateY(-2px); }

.footer-copy {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-bottom: 0.25rem;
}

.footer-year {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ======================== BACK TO TOP ======================== */
#back-to-top {
  display: none;
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  color: var(--accent);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  z-index: 100;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
#back-to-top:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 22px rgba(0, 212, 255, 0.4);
  transform: translateY(-2px);
}

.btn-entrance { animation: btnUp   0.3s var(--ease) both; }
.btn-exit     { animation: btnDown 0.25s ease both; }

@keyframes btnUp   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes btnDown { from { opacity: 1; } to { opacity: 0; transform: translateY(14px); } }

/* ======================== RESPONSIVE ======================== */
@media (max-width: 1100px) {
  .skills-grid   { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  #home { padding-left: 2rem; padding-right: 2rem; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .social-rail { display: none; }
  .nav-links   { display: none; }
  .hamburger   { display: flex; }
  .hero-corner { display: none; }
}

@media (max-width: 640px) {
  section { padding: 5rem 0; }

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

  .hero-name { font-size: clamp(2.8rem, 11vw, 4rem); letter-spacing: -1.5px; }
  .hero-desc { font-size: 0.93rem; }
  .section-heading { font-size: 1.4rem; }

  #nav { padding: 0 1.25rem; }
  .container { padding: 0 1.25rem; }

  .code-card-body { font-size: 0.72rem; }

  #back-to-top { bottom: 1.5rem; right: 1.5rem; }
}
