:root {
  --bg: #161412;
  --surface: #1f1c19;
  --border: #332e29;
  --text: #ece6df;
  --muted: #a39a90;
  --accent: #e07b39;
  --max: 1040px;
  --gutter: 20px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

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

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

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

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h2 {
  font-size: 1.9rem;
  margin-bottom: 1.2em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

.muted {
  color: var(--muted);
}

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

/* 3D background */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s;
}

#bg.ready {
  opacity: 1;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #1a1410;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: #ea8c4d;
  color: #1a1410;
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--outline:hover {
  background: var(--surface);
  color: var(--text);
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.nav__links {
  display: flex;
  gap: 24px;
}

.nav__links a {
  color: var(--muted);
  text-decoration: none;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--text);
}

.nav__toggle {
  display: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav__toggle {
    display: block;
  }

  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .nav.open .nav__links {
    display: flex;
  }

  .nav__links a {
    padding: 12px var(--gutter);
    border-top: 1px solid var(--border);
  }
}

/* Layout */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px var(--gutter) 0;
}

/* Hero */
.hero {
  max-width: var(--max);
  min-height: calc(100vh - 60px);
  margin: 0 auto;
  padding: 80px var(--gutter);
  display: flex;
  align-items: center;
}

.hero__inner {
  max-width: 560px;
}

.hero__role {
  margin-bottom: 8px;
  color: var(--accent);
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4rem);
  margin-bottom: 20px;
}

.hero__lede {
  color: var(--muted);
  font-size: 1.1rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 20px;
}

.hero__links a {
  margin-right: 18px;
}

/* About */
.about {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 40px;
}

.about__photo {
  width: 100%;
  border-radius: 6px;
}

.skills {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 10px 24px;
  margin: 0;
}

.skills dt {
  font-weight: 600;
}

.skills dd {
  margin: 0;
  color: var(--muted);
}

/* Experience */
.job {
  margin-bottom: 40px;
}

.job__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.job__head img {
  width: auto;
  max-width: 110px;
  height: 40px;
  padding: 5px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.job__head h3,
.job__head p {
  margin: 0;
}

.job ul {
  margin: 0;
  padding-left: 20px;
}

.job li {
  margin-bottom: 6px;
}

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

.plain li {
  margin-bottom: 6px;
}

/* Projects */
.projects {
  display: grid;
  gap: 24px;
  margin-bottom: 48px;
}

.project {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.project video,
.mini video {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #000;
}

.project__body {
  padding: 24px;
}

.project__links a {
  margin-right: 16px;
}

.minis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.mini {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.mini h4,
.mini p {
  margin-left: 16px;
  margin-right: 16px;
}

.mini h4 {
  margin-top: 14px;
}

.mini p {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

/* Contact */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.form {
  display: grid;
  gap: 14px;
}

.form label {
  display: grid;
  gap: 4px;
  font-weight: 600;
  font-size: 0.95rem;
}

.form input,
.form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  resize: vertical;
}

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

.form .btn {
  justify-self: start;
}

.form .btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.form__status {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.form__status:empty {
  display: none;
}

.form__status.is-success {
  color: var(--accent);
}

.form__status.is-error {
  color: #e8836a;
}

.hp {
  position: absolute;
  left: -9999px;
}

/* Footer */
.footer {
  max-width: var(--max);
  margin: 80px auto 0;
  padding: 24px var(--gutter) 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer p {
  margin: 0;
}

/* Responsive */
@media (max-width: 860px) {
  .project {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .about,
  .contact,
  .skills,
  .minis {
    grid-template-columns: 1fr;
  }

  .about__photo {
    max-width: 240px;
  }

  .skills dt {
    margin-top: 8px;
  }

  .nav__logo span {
    font-size: 0.95rem;
  }
}

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