@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #050505;
  --surface: #131313;
  --surface-2: #1c1c1c;
  --border: rgba(237, 237, 237, 0.1);
  --text: #ededed;
  --text-muted: rgba(237, 237, 237, 0.64);
  --accent: #bc8b52;
  --accent-ink: #050505;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --nav-h: 72px;
  --container: 1240px;
  --gutter: clamp(24px, 6vw, 96px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header / Nav ---------- */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--gutter);
  z-index: 200;
  background: linear-gradient(to bottom, rgba(5, 5, 5, 0.85), rgba(5, 5, 5, 0));
  backdrop-filter: blur(6px);
}

.logo {
  font-size: 22px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.02em;
}

.navbar {
  display: flex;
  align-items: center;
  gap: 40px;
}

.navbar a {
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  transition: color 0.25s var(--ease);
}

.navbar a:hover,
.navbar a.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding-inline: 28px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  border: 2px solid var(--accent);
  overflow: hidden;
  z-index: 1;
  transition: color 0.5s var(--ease), transform 0.2s var(--ease);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  z-index: -1;
  transition: width 0.5s var(--ease);
}

.btn:hover::before {
  width: 100%;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary::before {
  background: var(--bg);
}

.btn-primary:hover {
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
}

.btn-ghost::before {
  background: var(--accent);
}

.btn-ghost:hover {
  color: var(--accent-ink);
}

.icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 18px;
  text-decoration: none;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), transform 0.2s var(--ease);
}

.icon-link:hover {
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-2px);
}

.icon-row {
  display: flex;
  gap: 14px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  background: url('../Images/hero-bg.webp') no-repeat center / cover;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 64px;
}

.hero-content {
  max-width: 560px;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 1.9rem + 2.6vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
}

.hero-content .lede {
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  font-weight: 600;
  color: var(--accent);
  margin-top: 10px;
}

.hero-content p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 46ch;
  margin: 20px 0 36px;
}

.btn-box {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-sci {
  position: absolute;
  left: var(--gutter);
  bottom: 40px;
}

/* ---------- Reveal animation ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
}

[data-reveal].is-visible {
  animation: reveal-up 0.7s var(--ease) forwards;
}

@keyframes reveal-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Project hero (Projects page) ---------- */

.project-hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: url('../Images/projects-bg.webp') no-repeat center center / contain;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 64px;
}

.project-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(46% 40% at 50% 54%, rgba(5, 5, 5, 0.72), rgba(5, 5, 5, 0) 72%);
  pointer-events: none;
}

.project-hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin-inline: auto;
}

.project-hero-content h1 {
  font-size: clamp(2.5rem, 1.9rem + 2.6vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
}

.project-hero-content > p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 42ch;
  margin: 20px auto 0;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 18px;
  animation: scroll-cue-bounce 2.2s ease-in-out infinite;
}

@keyframes scroll-cue-bounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(6px);
  }
}

/* ---------- About ---------- */

.about {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: url('../Images/about-bg.webp') no-repeat center / cover;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 64px;
}

.profile-card {
  width: 100%;
  max-width: 480px;
  margin-right: 13vw;
}

.profile-photo {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--accent);
  margin-bottom: 20px;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.profile-card h2 span {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
}

.profile-card h3 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 24px;
}

.profile-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.profile-card .icon-row {
  margin-top: 24px;
}

/* ---------- Discord modal ---------- */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(5, 5, 5, 0.6);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.modal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-card h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.modal-card p {
  margin-top: 12px;
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.95rem;
}

/* ---------- Project cards ---------- */

.projects {
  padding: 96px var(--gutter) 96px;
  max-width: var(--container);
  margin-inline: auto;
}

.project-bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card--primary {
  grid-column: 1;
  grid-row: 1;
}

.project-card--secondary {
  grid-column: 2;
  grid-row: 1;
}

.project-card--soon {
  grid-column: 1 / -1;
  grid-row: 2;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at 85% -10%, rgba(188, 139, 82, 0.16), transparent 60%);
  pointer-events: none;
}

.project-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--accent);
  font-size: 20px;
  margin-bottom: 16px;
}

.project-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 8px;
  max-width: 48ch;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}

.project-card .btn {
  align-self: flex-start;
  margin-top: 20px;
  height: 40px;
  padding-inline: 18px;
  font-size: 0.85rem;
  gap: 8px;
}

.project-card .btn .icon {
  font-size: 16px;
}

.project-card--soon {
  flex-direction: row;
  align-items: center;
  gap: 20px;
  border-style: dashed;
  padding: 20px 24px;
}

.project-card--soon .project-icon {
  flex-shrink: 0;
  margin-bottom: 0;
  background: transparent;
  border: 1px dashed var(--border);
}

.project-card--soon-text {
  flex: 1;
  min-width: 0;
}

.project-card--soon h2 {
  font-size: 1.05rem;
}

.project-card--soon p {
  margin-top: 2px;
}

/* ---------- Footer ---------- */

.footer {
  padding: 32px var(--gutter) 48px;
  max-width: var(--container);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  :root {
    --gutter: 24px;
  }

  .navbar {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px var(--gutter) 20px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  }

  .navbar.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .navbar a {
    width: 100%;
    padding: 10px 0;
    font-size: 17px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero {
    justify-content: flex-start;
    background-position: 74% 46%;
    background-size: cover;
  }

  .about {
    justify-content: center;
    align-items: center;
    background-position: 26% 46%;
    background-size: cover;
  }

  .project-hero {
    background-image: url('../Images/projects-bg-mobile.webp');
    background-size: 92%;
  }

  .profile-card {
    margin-right: 0;
    max-width: 380px;
    text-align: center;
  }

  .profile-card .icon-row {
    justify-content: center;
  }

  .profile-photo {
    margin-inline: auto;
  }

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

  .project-card--primary,
  .project-card--secondary,
  .project-card--soon {
    grid-column: 1;
    grid-row: auto;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .project-card,
  .btn,
  .btn::before,
  .icon-link {
    transition: none;
  }

  .scroll-cue {
    animation: none;
  }
}
