:root {
  --bg: #0d0f14;
  --bg-alt: #12151c;
  --surface: #181c26;
  --border: #262b38;
  --text: #e8eaf0;
  --text-muted: #9aa1b2;
  --accent: #5eead4;
  --accent-strong: #2dd4bf;
  --accent-soft: rgba(94, 234, 212, 0.12);
  --max-width: 1140px;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Header / Nav */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
}

/* Hero */

.hero {
  padding: 100px 0 80px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin: 0 0 20px;
}

.hero-blurb {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 32px 0;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #05231e;
}

.btn-primary:hover {
  background: var(--accent-strong);
  color: #05231e;
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text);
}

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

.cinematic-toggle {
  position: relative;
  display: inline-block;
  overflow: hidden;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.cinematic-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cinematic-toggle[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cinematic-toggle-label {
  position: relative;
  z-index: 1;
}

.cinematic-toggle::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(94, 234, 212, 0.45), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  animation: cinematic-glimmer 4s ease-in-out infinite;
}

@keyframes cinematic-glimmer {
  0%, 15% {
    left: -60%;
  }
  55%, 100% {
    left: 130%;
  }
}

/* Sections */

section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 2rem;
  margin: 0 0 6px;
}

.section-subtitle {
  color: var(--text-muted);
  margin: 0 0 40px;
}

/* Projects */

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

a.project-card {
  cursor: pointer;
}

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

a.project-card:hover .project-thumb::after {
  opacity: 0.9;
}

.project-cta {
  display: inline-block;
  margin-top: 16px;
  font-weight: 600;
  color: var(--accent);
}

.project-thumb {
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-alt));
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.project-thumb img,
.project-thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-thumb::after {
  content: attr(data-label);
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  opacity: 0.6;
  text-align: center;
  padding: 12px;
}

.project-body {
  padding: 24px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.project-meta h3 {
  margin: 0;
  font-size: 1.4rem;
}

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

.project-role {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.tech-tags li {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

/* Cinematic mode */

body.cinematic-mode .project-grid {
  grid-template-columns: 1fr;
  max-width: 920px;
  margin: 0 auto;
  gap: 56px;
}

body.cinematic-mode .project-body > p:not(.project-role) {
  display: none;
}

.project-links a {
  font-weight: 600;
}

/* Devlog / project detail pages */

.devlog {
  padding: 48px 0 80px;
}

.back-link {
  display: inline-block;
  color: var(--text-muted);
  font-weight: 600;
  margin: 24px 0;
}

.back-link:hover {
  color: var(--accent);
}

.devlog-header {
  margin: 16px 0 40px;
}

.devlog-header h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
  margin: 8px 0 16px;
}

.devlog-intro {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 700px;
}

.resume-embed {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  max-width: 850px;
  aspect-ratio: 8.5 / 11;
}

.resume-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px 0 32px;
}

.devlog-section {
  margin-top: 40px;
  padding: 0;
  border-top: none;
}

.devlog-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 20px;
}

.devlog-section h2 {
  font-size: 1.6rem;
  margin: 0 0 18px;
}

.devlog-section h3 {
  font-size: 1.05rem;
  color: var(--accent);
  margin: 0 0 10px;
}

.devlog-section p {
  color: var(--text);
  max-width: 720px;
}

.devlog-caption {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 700px;
  margin: 16px 0 0;
}

.team-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin: 20px 0 24px;
}

.team-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
}

/* Placeholder slots for images/gifs/code screenshots not yet supplied */
.media-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 16px;
  margin: 20px 0;
}

.ability-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.ability-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.ability-thumb {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--bg-alt);
  margin-bottom: 12px;
  object-fit: cover;
  display: block;
}

.devlog-hero-img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 8px 0 32px;
}

.devlog-img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  margin: 20px auto;
}

.devlog-diagram {
  margin: 20px auto;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
}

.devlog-diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

.devlog-diagram figcaption {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.ability-card h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.ability-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 32px 0;
}

.video-embed iframe,
.video-embed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

/* Contact */

.contact-list {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 1.1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 560px;
  margin: 32px 0 0;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-field input,
.form-field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form button {
  align-self: flex-start;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}

.contact-alt {
  margin: 20px 0 0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.contact-alt .btn {
  font-size: 0.95rem;
  padding: 8px 16px;
}

.form-note {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

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

  .project-thumb {
    min-height: 100px;
  }
}
