/* TYPOGRAPHY */
@font-face {
  font-family: 'ClashGrotesk-Bold';
  src: url('fonts/ClashGrotesk-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'ClashGrotesk-Semibold';
  src: url('fonts/ClashGrotesk-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'ClashGrotesk-Medium';
  src: url('fonts/ClashGrotesk-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'ClashGrotesk-Regular';
  src: url('fonts/ClashGrotesk-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* THEME VARIABLES */
:root {
  --bg-primary: #FCFBF9;
  --bg-card: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #4A4A4A;
  --text-muted: #888888;
  --accent-primary: #5A7ACD;
  --border-editorial: 1px solid #1A1A1A;
  --border-light: 1px solid rgba(26, 26, 26, 0.1);
  --section-padding: 10rem 8vw;
  --transition-editorial: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --glass-bg: rgba(252, 251, 249, 0.9);
}

[data-theme="dark"] {
  --bg-primary: #0F0F0F;
  --bg-card: #151515;
  --text-primary: #F0F0F0;
  --text-secondary: #A0A0A0;
  --text-muted: #666666;
  --accent-primary: #8AB4F8;
  --border-editorial: 1px solid #F0F0F0;
  --border-light: 1px solid rgba(240, 240, 240, 0.1);
  --glass-bg: rgba(15, 15, 15, 0.9);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: clip;
}

body {
  font-family: 'ClashGrotesk-Regular', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: 'ClashGrotesk-Bold', sans-serif;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(4rem, 15vw, 12rem);
}

h2 {
  font-size: clamp(3rem, 10vw, 7rem);
}

h3 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

main {
  width: 100%;
  overflow: visible;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  z-index: 1000;
  border-bottom: var(--border-light);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition-editorial);
}

header.scrolled {
  height: 60px;
}

.logo {
  font-family: 'ClashGrotesk-Bold', sans-serif;
  text-transform: uppercase;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.nav-items {
  display: flex;
  align-items: center;
  gap: 3rem;
}

nav a {
  text-decoration: none;
  font-family: 'ClashGrotesk-Medium', sans-serif;
  color: var(--text-primary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  position: relative;
  transition: opacity 0.3s ease;
}

nav a:hover {
  opacity: 0.6;
}

nav a.active {
  color: var(--accent-primary);
}

.theme-switch-wrapper {
  display: flex;
  align-items: center;
}

.theme-switch {
  position: relative;
  width: 40px;
  height: 20px;
  cursor: pointer;
}

.theme-switch input {
  display: none;
}

.slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: var(--border-editorial);
  transition: 0.4s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background: var(--text-primary);
  transition: 0.4s;
}

input:checked+.slider:before {
  transform: translateX(20px);
}

.slider i {
  display: none;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4vw;
  transition: right 0.6s cubic-bezier(1, 0, 0, 1);
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav a {
  font-family: 'ClashGrotesk-Bold', sans-serif;
  font-size: 4rem;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-primary);
  line-height: 1;
  margin: 0.5rem 0;
  transition: var(--transition-editorial);
}

.menu-btn {
  display: none;
  width: 30px;
  height: 15px;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1001;
}

.menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-primary);
  transition: 0.3s;
}

.menu-btn.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-btn.open span:nth-child(2) {
  opacity: 0;
}

.menu-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

section {
  padding: var(--section-padding);
  border-bottom: var(--border-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.section-header {
  margin-bottom: 5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-number {
  font-family: 'ClashGrotesk-Medium', sans-serif;
  font-size: 0.85rem;
  opacity: 0.4;
}

#home {
  min-height: 100vh;
  padding: 140px 4vw 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.hero-editorial-wrap {
  position: relative;
  z-index: 5;
  margin-bottom: 2rem;
}

.hero-title {
  max-width: 100%;
  word-break: break-word;
  line-height: 0.85;
  /* inherits h1 size: clamp(4rem, 15vw, 12rem) */
  margin-bottom: 1rem;
}

.hero-footer {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
  align-items: start;
}

.hero-subtitle {
  grid-column: 1 / span 9;
  font-size: 1.15rem;
  line-height: 1.4;
  max-width: 500px;
}

.hero-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: 'ClashGrotesk-Medium', sans-serif;
  font-size: 0.65rem;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border: var(--border-editorial);
  letter-spacing: 0.05em;
}

/* Face pinned to the bottom border of #home */
#face-peek {
  position: absolute;
  bottom: 0;
  right: 80px;
  width: clamp(100px, 14vw, 220px);
  z-index: 10;
  pointer-events: none;
  display: block;
}

footer {
  padding: 8rem 4vw 4vw;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  border-top: var(--border-light);
  background: var(--bg-primary);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.footer-text {
  font-size: 0.75rem;
  opacity: 0.5;
  max-width: 400px;
  line-height: 1.4;
}

.footer-back-top {
  font-family: 'ClashGrotesk-Bold', sans-serif;
  text-transform: uppercase;
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  transition: 0.3s;
}

.footer-back-top:hover {
  color: var(--accent-primary);
}

.index-list {
  display: flex;
  flex-direction: column;
}

.index-row {
  display: grid;
  grid-template-columns: 0.5fr 2fr 3fr 1fr;
  padding: 2.5rem 0;
  border-top: var(--border-light);
  gap: 2rem;
  transition: var(--transition-editorial);
}

.index-row:hover {
  background: rgba(26, 26, 26, 0.02);
}

[data-theme="dark"] .index-row:hover {
  background: rgba(240, 240, 240, 0.02);
}

.index-row .date {
  font-family: 'ClashGrotesk-Medium', sans-serif;
  font-size: 0.85rem;
  opacity: 0.6;
}

.index-row .title-wrap h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.index-row .content-wrap {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.index-row ul {
  list-style: none;
  margin-top: 1rem;
}

.index-row li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.index-row li::before {
  content: "—";
  position: absolute;
  left: 0;
}

.company-logo {
  width: 40px;
  height: 40px;
  filter: grayscale(1);
  mix-blend-mode: multiply;
}

[data-theme="dark"] .company-logo {
  filter: grayscale(1) invert(1);
  mix-blend-mode: screen;
}

.project-spreads {
  display: flex;
  flex-direction: column;
  gap: 10rem;
}

.project-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4vw;
  align-items: start;
}

.project-info {
  position: sticky;
  top: 120px;
}

.project-info h3 {
  font-size: clamp(2rem, 5vw, 5rem);
  margin-bottom: 2rem;
}

.project-description {
  font-size: 1.2rem;
  margin-bottom: 3rem;
  max-width: 400px;
}

.project-visual {
  border: var(--border-editorial);
  aspect-ratio: 4 / 5;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn {
  text-decoration: none;
  font-family: 'ClashGrotesk-Bold', sans-serif;
  text-transform: uppercase;
  font-size: 0.8rem;
  padding: 0.8rem 1.5rem;
  border: var(--border-editorial);
  color: var(--text-primary);
  display: inline-block;
  margin-right: 1rem;
  transition: var(--transition-editorial);
}

.btn:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.skills-index {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10vw;
}

.skill-category h3 {
  font-size: 1rem;
  opacity: 0.4;
  margin-bottom: 3rem;
  border-bottom: var(--border-light);
  padding-bottom: 1rem;
}

.skill-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.skill-item img {
  width: 20px;
  height: 20px;
  filter: grayscale(1);
}

.skill-item span {
  font-family: 'ClashGrotesk-Medium', sans-serif;
  font-size: 1.1rem;
}

#contact {
  min-height: 80vh;
  justify-content: space-between;
}

.contact-wrap {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 5vw;
}

.contact-statement {
  font-size: clamp(2rem, 6vw, 5rem);
  font-family: 'ClashGrotesk-Bold', sans-serif;
  line-height: 1;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: flex-end;
}

.contact-link {
  font-family: 'ClashGrotesk-Bold', sans-serif;
  font-size: 3rem;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 0.8;
  transition: var(--transition-editorial);
  position: relative;
}

.email-link:hover {
  color: #EA4335;
}

.linkedin-link:hover {
  color: #0a66c2;
}

.github-link:hover {
  color: #7c3aed;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (max-width: 1024px) {
  .index-row {
    grid-template-columns: 1fr 3fr;
  }

  .index-row .date,
  .index-row .company-logo {
    order: 1;
  }

  .index-row .title-wrap {
    grid-column: 1 / -1;
    order: 2;
  }

  .index-row .content-wrap {
    grid-column: 1 / -1;
    order: 3;
  }

  .project-item {
    grid-template-columns: 1fr;
  }

  .project-info {
    position: static;
  }

  .hero-footer {
    grid-template-columns: 1fr;
  }

  .hero-subtitle {
    grid-column: 1;
  }

  .hero-meta {
    grid-column: 1;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 6rem 5vw;
  }

  .menu-btn {
    display: flex;
  }

  nav {
    display: none;
  }

  h1 {
    font-size: 15vw;
  }

  h2 {
    font-size: 12vw;
  }

  .skills-index {
    grid-template-columns: 1fr;
  }

  .skill-list {
    grid-template-columns: 1fr;
  }

  .contact-wrap {
    grid-template-columns: 1fr;
  }

  .contact-links {
    align-items: flex-start;
  }

  .contact-link {
    font-size: 15vw;
  }
}