: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: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.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-right {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.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-links a.active {
  color: var(--accent);
}

.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;
}

/* Header search */

.nav-search {
  position: relative;
}

.nav-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.nav-search-toggle:hover,
.nav-search-toggle[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--border);
}

.nav-search-toggle svg {
  width: 18px;
  height: 18px;
}

.nav-search-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 110;
}

.nav-search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.nav-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.nav-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
}

.nav-search-results:not(:empty) {
  margin-top: 8px;
}

.nav-search-results li + li {
  margin-top: 2px;
}

.nav-search-results a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 6px;
}

.nav-search-results a:hover {
  background: var(--accent-soft);
}

.nav-search-result-title {
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
}

.nav-search-result-role {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.nav-search-empty {
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Hero */

.hero {
  padding: 56px 0 48px;
}

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

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

.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;
}

.lock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(13, 15, 20, 0.85);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Early-access password gate */

html.locked .site-header,
html.locked main,
html.locked .site-footer {
  display: none;
}

.lock-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 6, 10, 0.85);
  backdrop-filter: blur(4px);
}

.lock-gate[hidden] {
  display: none;
}

.lock-gate-box {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

.lock-gate-box h2 {
  margin: 0 0 8px;
}

.lock-gate-box p {
  color: var(--text-muted);
  margin: 0 0 20px;
}

.lock-gate-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.lock-gate-close:hover {
  color: var(--text);
}

#lockGateForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#lockGateInput {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
}

#lockGateInput:focus {
  outline: none;
  border-color: var(--accent);
}

.lock-gate-error {
  color: #f87171;
  font-size: 0.85rem;
  margin: 12px 0 0;
}

.lock-gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lock-gate-input {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
}

.lock-gate-input:focus {
  outline: none;
  border-color: var(--accent);
}

.build-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.build-download p {
  margin: 0;
  color: var(--text-muted);
}

.build-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.build-download-icon {
  width: 18px;
  height: 18px;
}

.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;
}

.tech-tags li.tag-spacer {
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  align-self: stretch;
  width: 0;
  padding: 0;
  margin: 0 2px;
}

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

/* Cinematic mode */

body.cinematic-mode .project-grid {
  grid-template-columns: 1fr;
  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-wrap {
  max-width: 850px;
  aspect-ratio: 8.5 / 11;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.resume-embed {
  width: 850px;
  aspect-ratio: 8.5 / 11;
  background: #fff;
  transform-origin: top left;
}

.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: grid;
  grid-template-columns: repeat(3, 1fr);
  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-gallery {
  position: relative;
  margin: 20px auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.devlog-gallery .devlog-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.devlog-gallery .devlog-img.is-active {
  opacity: 1;
}

.devlog-gallery-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.devlog-gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(232, 234, 240, 0.35);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.devlog-gallery-dot.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

.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;
}

/* Development history (live, folded commit feed) */

.dev-history-fold {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  padding: 18px 20px;
}

.dev-history-fold summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.dev-history-fold summary::-webkit-details-marker {
  display: none;
}

.dev-history-fold summary::before {
  content: "+";
  display: inline-block;
  width: 1.1em;
  color: var(--accent);
  font-weight: 700;
}

.dev-history-fold[open] summary::before {
  content: "\2212";
}

.dev-history-hint {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.85rem;
}

.dev-history-body {
  margin-top: 18px;
}

.dev-history-body p {
  color: var(--text-muted);
  max-width: 720px;
  font-size: 0.95rem;
}

.dev-history-status {
  margin: 0 !important;
  padding: 16px 14px;
  font-size: 0.85rem !important;
  color: var(--text-muted);
}

.dev-history-wrap {
  margin-top: 18px;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.dev-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dev-history-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.dev-history-row:last-child {
  border-bottom: 0;
}

.dev-history-time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  flex: 0 0 auto;
}

.dev-history-msg {
  color: var(--text);
  flex: 1 1 240px;
}

@media (max-width: 720px) {
  .dev-history-row {
    flex-direction: column;
    gap: 4px;
  }

  .cinematic-toggle {
    display: none;
  }
}

/* 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;
  }

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

@media (max-width: 960px) and (min-width: 721px) {
  .ability-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
