:root {
  --bg: #dfe2e6;
  --ink: #1c1d1f;
  --slate: #4a4f4a;
  --muted: #4a4f4a;
  --surface: #d4d8de;
  --surface-alt: #c8cdd4;
  --accent: #f05a28;
  --line: rgba(74, 79, 74, 0.35);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px)
}

@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) {
    --bg: #232831;
    --ink: #eceef2;
    --slate: #4a4f4a;
    --muted: #9aa3b2;
    --surface: #1c1d1f;
    --surface-alt: #282c32;
    --accent: #f05a28;
    --line: #4a4f4a
  }
}

:root[data-theme="dark"] {
  --bg: #232831;
  --ink: #eceef2;
  --slate: #4a4f4a;
  --muted: #9aa3b2;
  --surface: #1c1d1f;
  --surface-alt: #282c32;
  --accent: #f05a28;
  --line: #4a4f4a
}

*,
*::before,
*::after {
  box-sizing: inherit
}

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
  scroll-behavior: smooth
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "Instrument Sans", system-ui, sans-serif
}

h1,
h2,
h3 {
  font-family: Outfit, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.05;
  margin: 0
}

a {
  color: inherit
}

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

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  font-weight: 500
}

nav div {
  display: flex;
  gap: 1.5rem
}

nav a {
  text-decoration: none
}

nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: Outfit, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  text-decoration: none
}

.brand:hover {
  text-decoration: none;
  opacity: 0.9
}

.brand-mark {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0
}

.brand-mark .logo-a {
  stroke: #4a4f4a
}

@media (prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) .brand-mark .logo-a {
    stroke: #eceef2
  }
}

:root[data-theme="dark"] .brand-mark .logo-a {
  stroke: #eceef2
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
  min-height: 78vh;
  padding: 2rem 0 3rem
}

.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.1
}

.hero p {
  max-width: 34ch;
  color: var(--muted);
  margin: 1.25rem 0 0
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem
}

.scene {
  width: 420px;
  height: 420px;
  touch-action: none;
  cursor: grab;
  position: relative;
  display: grid;
  place-items: center
}

.scene:active {
  cursor: grabbing
}

.scene::after {
  content: "";
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 56%;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(28, 29, 31, 0.34) 0%, rgba(28, 29, 31, 0) 72%);
  pointer-events: none;
  z-index: -1
}

.cube {
  width: 100%;
  height: 100%;
  position: relative
}

.cube canvas {
  width: 100%;
  height: 100%;
  display: block
}

.passes {
  display: flex;
  gap: .5rem
}

.passes button {
  font: inherit;
  font-weight: 500;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--slate);
  border-radius: 999px;
  padding: .4rem 1rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease
}

.passes button:hover {
  border-color: var(--accent)
}

.passes button[aria-pressed=true] {
  background: #1c1d1f;
  color: #eceef2;
  border-color: #f05a28
}

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

section {
  padding: 4rem 0;
  border-top: 1.5px solid var(--line)
}

section h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 1.75rem
}

/* --- OUR WORK SECTION (MODELED AFTER REFERENCE) --- */
.work-heading {
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2.25rem
}

.work-squares {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.35rem;
  position: relative
}

.work-sq {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.1rem;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transform-origin: center center;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s ease,
    box-shadow 0.28s ease,
    opacity 0.22s ease
}

.work-squares:hover .work-sq:not(:hover) {
  opacity: 0.72
}

.work-sq:hover,
.work-sq:focus-visible {
  z-index: 10;
  transform: scale(1.1);
  border-color: var(--accent);
  box-shadow: 0 24px 48px rgba(28, 29, 31, 0.42), 0 0 0 1px var(--accent);
  opacity: 1
}

.sq-top {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  pointer-events: none
}

.sq-num {
  font: 600 0.92rem/1 Outfit, sans-serif;
  color: var(--muted);
  letter-spacing: 0.04em
}

.sq-top h3 {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase
}

.sq-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  border: 1px solid var(--line);
  background-color: #16181a;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none
}

.sq-media .vid {
  pointer-events: none;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: transparent
}

.sq-foot {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none
}

.sq-tag {
  font: 700 0.74rem/1.2 Outfit, sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent)
}

.sq-foot p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted)
}

.sq-link {
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink)
}

.work-sq:hover .sq-link {
  color: var(--accent)
}

.work-cta {
  display: flex;
  justify-content: center;
  margin-top: 2.25rem
}

.view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 600 0.86rem/1 Outfit, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  background: #1c1d1f;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  padding: 0.75rem 1.4rem;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease
}

.view-all-btn:hover {
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-1px)
}

.vid {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1c1d1f
}

/* --- FULL WORK ARCHIVE PAGE (work.html) --- */
.archive-head {
  padding: 2.5rem 0 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.25rem
}

.archive-head h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  letter-spacing: 0.02em;
  text-transform: uppercase
}

.archive-head p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  max-width: 54ch
}

.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem
}

.archive-filters button {
  font: 600 0.82rem/1 Outfit, sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--slate);
  border-radius: 999px;
  padding: 0.48rem 1rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease
}

.archive-filters button:hover {
  border-color: var(--accent)
}

.archive-filters button[aria-pressed="true"] {
  background: #1c1d1f;
  color: #eceef2;
  border-color: var(--accent)
}

.archive-list {
  display: grid;
  gap: 1.5rem;
  padding-bottom: 3rem
}

.archive-item[hidden] {
  display: none
}

.archive-badge {
  display: inline-block;
  font: 700 0.74rem/1.2 Outfit, sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem
}

/* --- CUSTOM ANYRENDER VIDEO PLAYER --- */
.ar-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #1c1d1f;
  user-select: none
}

.ar-player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #1c1d1f;
  cursor: pointer
}

.ar-big-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(28, 29, 31, 0.86);
  border: 2px solid var(--accent);
  color: #eceef2;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease
}

.ar-big-play:hover {
  background: var(--accent);
  color: #fff;
  transform: translate(-50%, -50%) scale(1.08)
}

.ar-big-play svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  margin-left: 3px
}

.ar-player.is-playing .ar-big-play {
  opacity: 0;
  pointer-events: none
}

.ar-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: linear-gradient(to top, rgba(28, 29, 31, 0.94) 0%, rgba(28, 29, 31, 0.72) 75%, rgba(28, 29, 31, 0) 100%);
  color: #eceef2;
  transition: opacity 0.22s ease
}

.ar-player.is-playing:not(:hover):not(:focus-within) .ar-controls {
  opacity: 0
}

.ar-btn {
  background: transparent;
  border: 0;
  color: #eceef2;
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.16s ease, background 0.16s ease
}

.ar-btn:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08)
}

.ar-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor
}

.ar-seek {
  flex: 1;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative
}

.ar-track {
  width: 100%;
  height: 4px;
  background: rgba(236, 238, 242, 0.24);
  border-radius: 999px;
  position: relative;
  overflow: visible;
  transition: height 0.14s ease
}

.ar-seek:hover .ar-track {
  height: 6px
}

.ar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  position: relative
}

.ar-fill::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #eceef2;
  border: 2px solid var(--accent);
  transition: transform 0.14s ease
}

.ar-seek:hover .ar-fill::after {
  transform: translateY(-50%) scale(1)
}

.ar-time {
  font: 500 0.76rem/1 "Instrument Sans", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #cfd5df;
  white-space: nowrap;
  flex-shrink: 0
}

/* --- SHOWCASE MODAL WINDOW --- */
.work-modal {
  width: min(960px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  padding: 0;
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.55);
  overflow: auto
}

.work-modal::backdrop {
  background: rgba(28, 29, 31, 0.78);
  backdrop-filter: blur(4px)
}

.modal-inner {
  padding: 1.75rem 2rem 2.25rem;
  display: grid;
  gap: 1.25rem
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 1rem
}

.modal-head>div {
  display: flex;
  align-items: baseline;
  gap: 0.75rem
}

.modal-num {
  font: 700 1.15rem/1 Outfit, sans-serif;
  color: var(--accent)
}

.modal-head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  margin: 0
}

.modal-close {
  background: #1c1d1f;
  color: #eceef2;
  border: 1.5px solid var(--slate);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: border-color 0.18s ease, background 0.18s ease
}

.modal-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff
}

.modal-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 68ch
}

.modal-videos {
  display: grid;
  gap: 1.5rem
}

.modal-project {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.25rem;
  align-items: center
}

.modal-project-info h3 {
  font-size: 1.25rem;
  margin-bottom: 0.45rem
}

.modal-project-info p {
  margin: 0 0 0.85rem;
  font-size: 0.94rem;
  color: var(--muted)
}

.modal-specs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.86rem;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem
}

.modal-specs li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem
}

.modal-specs span:first-child {
  color: var(--muted)
}

.modal-specs span:last-child {
  font-weight: 600;
  text-align: right
}

/* --- ABOUT & TOOLS --- */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem
}

.about p {
  margin: 0 0 1rem;
  max-width: 60ch
}

dl {
  margin: 0
}

dt {
  font-weight: 600
}

dd {
  margin: 0 0 1rem;
  color: var(--muted)
}

.tools-dd {
  margin-top: 0.5rem
}

.tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.15rem
}

.tool-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2
}

.tool-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  border-radius: 4px
}

/* --- CONTACT, TIMELINE & LOOK-DEV TEST --- */
.mail {
  font: 500 1.15rem/1.4 "Instrument Sans", system-ui, sans-serif;
  overflow-wrap: anywhere;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  text-decoration-color: var(--accent)
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 2.25rem
}

.fh {
  margin: 0;
  font-size: 1.4rem
}

form {
  display: grid;
  gap: 1rem;
  max-width: 560px;
  margin-top: 1.15rem
}

.contact-guide {
  display: grid;
  gap: 1.1rem
}

.timeline-card,
.lookdev-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 1.35rem
}

.lookdev-card {
  border-color: rgba(240, 90, 40, 0.55)
}

.guide-eyebrow {
  display: block;
  font: 700 0.74rem/1.2 Outfit, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem
}

.micro-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  position: relative
}

.micro-timeline li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  position: relative
}

.micro-timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 38px;
  bottom: -12px;
  width: 1.5px;
  background: var(--line)
}

.tl-icon,
.lookdev-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #1c1d1f;
  border: 1.5px solid rgba(240, 90, 40, 0.55);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0
}

.tl-icon svg,
.lookdev-icon svg {
  width: 18px;
  height: 18px
}

.micro-timeline strong {
  font: 600 0.96rem/1.25 Outfit, sans-serif;
  color: var(--ink)
}

.lookdev-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.7rem
}

.lookdev-head .guide-eyebrow {
  margin-bottom: 0.2rem
}

.lookdev-head h3 {
  font-size: 1.08rem;
  line-height: 1.2
}

.lookdev-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.48;
  color: var(--muted)
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem
}

label {
  display: grid;
  gap: .35rem;
  font-weight: 500
}

input,
textarea {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--slate);
  border-radius: 6px;
  padding: .7rem .8rem;
  width: 100%
}

input:focus,
textarea:focus {
  border-color: var(--accent)
}

textarea {
  min-height: 140px;
  resize: vertical
}

.send {
  justify-self: start;
  font: 500 1rem "Instrument Sans", system-ui, sans-serif;
  background: #1c1d1f;
  color: #eceef2;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: .75rem 1.6rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease
}

.send:hover {
  background: var(--accent);
  color: #fff
}

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

footer {
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: .9rem
}

@media (max-width: 920px) {
  .work-squares {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin: 0 auto
  }

  .work-sq:hover,
  .work-sq:focus-visible {
    transform: scale(1.03)
  }

  .modal-project,
  .contact-grid {
    grid-template-columns: 1fr
  }
}

@media (max-width: 760px) {
  .row {
    grid-template-columns: 1fr
  }

  .hero,
  .about {
    grid-template-columns: 1fr
  }

  .hero {
    min-height: 0
  }

  .scene {
    width: 300px;
    height: 300px
  }

  .modal-inner {
    padding: 1.25rem 1.25rem 1.5rem
  }
}

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