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

:root {
  --bg: #f9f9f7;
  --text: #111110;
  --text2: #888884;
  --text3: #bbbbb7;
  --border: #e4e4e0;
  --green: #1a6b3c;
  --nav-bg: rgba(249, 249, 247, 0.92);
}

[data-theme='dark'] {
  --bg: #111110;
  --text: #f0f0ec;
  --text2: #777772;
  --text3: #444440;
  --border: #222220;
  --green: #4caf78;
  --nav-bg: rgba(17, 17, 16, 0.92);
}

html {
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

/* CURSOR */
.cursor {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition:
    transform 0.1s ease,
    width 0.2s ease,
    height 0.2s ease,
    background 0.2s ease;
}

.cursor.hovering {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--text);
}

/* NAV */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

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

.nav-logo {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--text2);
  text-decoration: none;
  transition: color 0.15s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--text);
  transition: width 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}
.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--text);
}
.nav-links a.active::after {
  width: 100%;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  color: var(--green);
}

/* THEME TOGGLE */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  cursor: none;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.04em;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--text3);
  color: var(--text2);
}

.theme-toggle-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2.5s ease infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* HERO */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 2.5rem 4rem;
  border-bottom: 1px solid var(--border);
}

.hero-name {
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.95;
  padding-top: 8rem;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.hero-name.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.8s 0.25s ease,
    transform 0.8s 0.25s ease;
}

.hero-bottom.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-role {
  font-size: 13px;
  color: var(--text2);
}

.hero-desc {
  max-width: 340px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
  text-align: right;
}

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

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* SECTIONS */
section {
  border-bottom: 1px solid var(--border);
}

.section-inner {
  padding: 5rem 2.5rem;
}

.section-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 4rem;
  align-items: start;
}

.section-label {
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 0.15rem;
}

/* SKILLS */
.skills-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
}

.skill-item {
  padding: 1.75rem 2rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.skill-item:hover {
  background: rgba(128, 128, 128, 0.04);
}
.skill-item:nth-child(3n) {
  border-right: none;
}
.skill-item:nth-child(n + 4) {
  border-bottom: none;
}

.skill-category {
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0;
}

.skill-tag {
  font-size: 12px;
  color: var(--text2);
}
.skill-tag::after {
  content: ',\00a0';
}
.skill-tag:last-child::after {
  content: '';
}

/* PROJECTS */
.projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.project-item {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-item:hover {
  transform: translateY(-4px);
  border-color: var(--text3);
}
.project-item:first-child {
  padding-top: 0;
}
.project-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.project-num {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 0.6rem;
}

.project-name {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 13px;
  color: var(--text2);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.project-tech-row {
  display: flex;
  gap: 1rem;
}

.project-tech-tag {
  font-size: 11px;
  color: var(--text3);
}

.py {
  color: #3776ab;
}

.js {
  color: #f7df1e;
}

.project-links {
  margin-top: auto;
  display: flex;
  gap: 1rem;
}

.project-link {
  font-size: 12px;
  color: var(--text3);
  text-decoration: none;
  transition: color 0.15s;
}

.project-link:hover {
  color: var(--text);
}

/* ABOUT */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
}

.about-bio {
  font-size: 15px;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.8;
}

.about-bio strong {
  font-weight: 400;
}

.timeline {
  display: flex;
  flex-direction: column;
}

.tl-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.tl-item:first-child {
  padding-top: 0;
}
.tl-item:last-child {
  border-bottom: none;
}

.tl-year {
  font-size: 11px;
  color: var(--text3);
  padding-top: 0.1rem;
}
.tl-role {
  font-size: 13px;
  margin-bottom: 0.1rem;
}
.tl-company {
  font-size: 12px;
  color: var(--text2);
}

/* CONTACT */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
}

.contact-heading {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.contact-note {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.contact-link-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.contact-link-item:first-child {
  border-top: 1px solid var(--border);
}

.contact-link-label {
  font-size: 11px;
  color: var(--text3);
}

.contact-link-val {
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.contact-link-val:hover {
  color: var(--text2);
}

/* FORM */
.contact-form {
  display: flex;
  flex-direction: column;
}

.form-field {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  transition: border-color 0.2s;
}

.form-field:first-child {
  border-top: 1px solid var(--border);
}
.form-field:focus-within {
  border-color: var(--text);
}

.form-field-label {
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.form-field:focus-within .form-field-label {
  color: var(--text2);
}

.form-field input,
.form-field textarea {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text);
  resize: none;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text3);
}
.form-field textarea {
  min-height: 80px;
}

.form-submit {
  margin-top: 1.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--bg);
  background: var(--text);
  border: none;
  padding: 0.75rem 1.5rem;
  cursor: none;
  align-self: flex-start;
  transition: opacity 0.15s;
}

.form-submit:hover {
  opacity: 0.7;
}

.form-submit.sent {
  opacity: 0.4;
  pointer-events: none;
}

/* FOOTER */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2.5rem;
}

.footer-copy {
  font-size: 11px;
  color: var(--text3);
}

.footer-back {
  font-size: 11px;
  color: var(--text3);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-back:hover {
  color: var(--text);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  body {
    cursor: auto;
  }
  .cursor {
    display: none;
  }
  nav {
    padding: 1rem 1.25rem;
  }
  .nav-links {
    display: none;
  }
  .hero {
    padding: 0 1.25rem 3rem;
  }
  .section-inner {
    padding: 3rem 1.25rem;
  }
  .section-row {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .skills-list {
    grid-template-columns: 1fr 1fr;
  }
  .skill-item:nth-child(3n) {
    border-right: 1px solid var(--border);
  }
  .skill-item:nth-child(2n) {
    border-right: none;
  }
  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .hero-desc {
    text-align: left;
  }
  footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}
