:root {
  color-scheme: light;
  --ink: #273630;
  --deep: #273630;
  --green: #273630;
  --lime: #cce6ce;
  --mint: #cce6ce;
  --paper: #f7fbf0;
  --panel: rgba(255, 255, 247, 0.86);
  --line: #273630;
  --shadow: 8px 8px 0 #273630;
  --display: "Cubano", Impact, Haettenschweiler, "Arial Black", sans-serif;
  --body: "Nunito", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(204, 230, 206, 0.78), transparent 30rem),
    linear-gradient(135deg, #f9fff3 0%, #cce6ce 52%, #eff7ef 100%);
  font-family: var(--body);
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(circle, rgba(16, 32, 21, 0.12) 1px, transparent 1.5px),
    linear-gradient(90deg, rgba(16, 32, 21, 0.05) 1px, transparent 1px);
  background-size: 12px 12px, 64px 64px;
  mix-blend-mode: multiply;
}

a {
  color: inherit;
}

button,
a.button {
  font: inherit;
}

#comic-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 2;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(204, 230, 206, 0.96);
  border-bottom: 2px solid rgba(39, 54, 48, 0.26);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  color: #fafff4;
  background: var(--deep);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 #fafff4;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #fafff4;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 2rem);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

nav a,
.site-footer a {
  text-decoration: none;
}

nav a:hover,
.site-footer a:hover {
  color: var(--green);
}

.hero {
  width: min(100%, 1680px);
  min-height: calc(100svh - 5rem);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(20rem, 0.82fr);
  align-items: center;
  gap: clamp(1.25rem, 4vw, 4rem);
  padding: clamp(1rem, 4vw, 3rem);
}

.hero-media {
  position: relative;
  min-height: min(74svh, 48rem);
  overflow: hidden;
  background: #0f1b13;
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  clip-path: polygon(0 0, 100% 3%, 96% 100%, 3% 96%);
}

.hero-media video {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
  filter: saturate(0.88) contrast(1.15);
}

.hero-copy {
  max-width: 38rem;
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.95;
  text-transform: uppercase;
}

h1 {
  max-width: 18ch;
  font-size: clamp(2.75rem, 4.8vw, 5.25rem);
}

h2 {
  font-size: clamp(2.35rem, 5vw, 4.6rem);
}

h3 {
  font-size: clamp(1.9rem, 3vw, 3rem);
}

.lede,
.comic-caption,
.content-block p,
.editor-note {
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.button,
.filters button,
.icon-button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  color: var(--ink);
  background: #fbfff5;
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 rgba(16, 32, 21, 0.24);
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.button.primary,
.filters button.active,
.button.active {
  color: #fafff4;
  background: var(--green);
}

.button:hover,
.filters button:hover,
.icon-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(16, 32, 21, 0.32);
}

.intro-strip {
  width: calc(100% - clamp(2rem, 8vw, 6rem));
  max-width: 1680px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 auto;
  border: 3px solid var(--line);
  background: #fbfff5;
  box-shadow: var(--shadow);
}

.intro-strip div {
  padding: clamp(1rem, 3vw, 1.6rem);
  border-right: 2px solid var(--line);
}

.intro-strip div:last-child {
  border-right: 0;
}

.intro-strip strong {
  display: block;
  color: var(--deep);
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.intro-strip span {
  font-weight: 850;
  text-transform: uppercase;
}

.work-section,
.project-detail,
.about-section {
  max-width: 1680px;
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem);
}

.section-heading {
  max-width: 48rem;
  margin-bottom: 1.5rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.4rem;
}

.filters button {
  min-height: 2.35rem;
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1rem, 2vw, 1.35rem);
}

.project-card {
  grid-column: span 4;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 rgba(16, 32, 21, 0.26);
  cursor: pointer;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.project-card:nth-child(4n + 1) {
  grid-column: span 5;
}

.project-card:nth-child(6n + 3) {
  grid-column: span 7;
}

.project-card:hover {
  transform: translateY(-0.45rem) rotate(0deg);
  box-shadow: 10px 10px 0 rgba(16, 32, 21, 0.32);
}

.project-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 3px solid var(--line);
  filter: saturate(0.92) contrast(1.08);
}

.project-card figcaption {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
}

.project-card strong {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2vw, 2.2rem);
  line-height: 1;
  text-transform: uppercase;
}

.project-card span {
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

.project-card em {
  color: rgba(39, 54, 48, 0.72);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.project-detail {
  background: rgba(255, 255, 247, 0.42);
  border-top: 3px solid rgba(39, 54, 48, 0.18);
}

.project-sections {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.content-block {
  display: grid;
  grid-template-columns: minmax(16rem, 0.95fr) minmax(18rem, 1.05fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  padding: clamp(1rem, 3vw, 1.4rem);
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 rgba(39, 54, 48, 0.24);
}

.content-block.text-block {
  display: block;
  max-width: 62rem;
}

.content-block.centered {
  grid-template-columns: minmax(0, min(100%, 62rem));
  justify-content: center;
  text-align: center;
}

.content-block.media-only {
  grid-template-columns: minmax(0, min(100%, 72rem));
  justify-content: center;
}

.content-block img,
.content-block video {
  width: 100%;
  max-height: 34rem;
  display: block;
  object-fit: contain;
  background: #fafff4;
  border: 2px solid var(--line);
}

.content-block.centered img,
.content-block.centered video {
  max-height: 48rem;
}

.content-block h3 {
  margin-bottom: 0.75rem;
}

.section-item {
  background: #fbfff5;
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 rgba(39, 54, 48, 0.24);
}

.section-item label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.72rem;
  color: var(--ink);
  background: #fafff4;
  border: 2px solid var(--line);
  font: 400 1rem var(--body);
}

textarea {
  resize: vertical;
}

.drop-zone {
  min-height: 8rem;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  background: rgba(204, 230, 206, 0.52);
  border: 2px dashed var(--line);
  cursor: pointer;
}

.drop-zone.dragging,
.drop-zone.has-file {
  background: #cce6ce;
  box-shadow: inset 0 0 0 4px #fafff4;
}

.drop-zone input {
  border: 0;
  padding: 0;
  background: transparent;
}

.editor-actions,
.section-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.section-list {
  display: grid;
  gap: 1rem;
}

.section-item {
  display: grid;
  grid-template-columns: 2rem minmax(8rem, 14rem) 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem;
}

.section-fields {
  display: grid;
  gap: 0.8rem;
}

.section-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.section-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.section-options input {
  width: auto;
}

.owner-lock {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(39, 54, 48, 0.72);
  backdrop-filter: blur(10px);
}

.owner-card {
  width: min(30rem, 100%);
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 4vw, 2rem);
  background: #fbfff5;
  border: 3px solid var(--line);
  box-shadow: 10px 10px 0 rgba(39, 54, 48, 0.34);
}

.owner-card label,
.studio-panel label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.owner-error {
  margin: 0;
  color: #8f1f1f;
  font-weight: 900;
}

.studio-open {
  overflow: hidden;
}

.admin-studio {
  position: fixed;
  inset: 0;
  z-index: 1800;
  overflow: auto;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(250, 255, 244, 0.98), rgba(204, 230, 206, 0.98)),
    #cce6ce;
}

.studio-topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  background: rgba(250, 255, 244, 0.94);
  border-bottom: 3px solid var(--line);
  backdrop-filter: blur(14px);
}

.studio-topbar h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.studio-grid {
  display: grid;
  grid-template-columns: 17rem minmax(18rem, 24rem) minmax(18rem, 24rem) minmax(28rem, 1fr);
  gap: 1rem;
  padding: 1rem;
  align-items: start;
}

.studio-rail,
.studio-panel,
.studio-preview {
  background: #fbfff5;
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 rgba(39, 54, 48, 0.22);
}

.studio-rail {
  position: sticky;
  top: 7.75rem;
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
}

.studio-projects {
  display: grid;
  gap: 0.55rem;
}

.studio-project {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  padding: 0.75rem;
  color: var(--ink);
  background: #fafff4;
  border: 2px solid var(--line);
  cursor: pointer;
  text-align: left;
}

.studio-project.active {
  color: #fafff4;
  background: var(--deep);
}

.studio-project span {
  font-weight: 950;
  text-transform: uppercase;
}

.studio-project small {
  font-weight: 800;
}

.studio-panel {
  position: sticky;
  top: 7.75rem;
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.panel-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  text-transform: uppercase;
}

.block-palette {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.studio-preview {
  min-height: calc(100vh - 9rem);
  padding: 1rem;
}

.preview-header {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.preview-header p {
  margin: 0;
}

.drag-handle {
  display: grid;
  place-items: center;
  min-height: 100%;
  color: #fafff4;
  background: var(--deep);
  font-family: var(--display);
}

.section-preview img,
.section-preview video {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
  border: 2px solid var(--line);
}

.section-preview span {
  display: grid;
  min-height: 6rem;
  place-items: center;
  background: var(--lime);
  border: 2px solid var(--line);
  font-family: var(--display);
}

.about-section {
  display: grid;
  grid-template-columns: minmax(18rem, 0.52fr) minmax(20rem, 0.9fr);
  justify-content: center;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  background: rgba(223, 245, 207, 0.62);
  border-top: 3px solid rgba(16, 32, 21, 0.18);
  border-bottom: 3px solid rgba(16, 32, 21, 0.18);
}

.comic-reader {
  display: grid;
  gap: 1rem;
}

.comic-book {
  position: relative;
  width: min(100%, 48rem);
  aspect-ratio: 1920 / 2967;
  perspective: 1600px;
  outline: none;
  cursor: grab;
  isolation: isolate;
  overflow: hidden;
}

.comic-book:active {
  cursor: grabbing;
}

.comic-book:focus-visible {
  outline: 4px solid var(--deep);
  outline-offset: 0.35rem;
}

.comic-page {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  padding: clamp(0.6rem, 2vw, 1.1rem);
  background: #fbfff5;
  border: 3px solid var(--line);
  box-shadow: 10px 10px 0 rgba(39, 54, 48, 0.28);
  transform-origin: left center;
  transform: rotateY(-88deg) translateX(1.5rem);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 420ms ease, opacity 240ms ease, box-shadow 240ms ease;
  will-change: transform;
  z-index: 0;
}

.comic-page.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: rotateY(0deg) translateX(0);
  z-index: 1;
}

.comic-page.turning-next {
  transform: rotateY(-16deg) translateX(0.25rem);
}

.comic-page.turning-prev {
  transform: rotateY(16deg) translateX(-0.25rem);
}

.comic-page img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.comic-controls {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.comic-dots {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.comic-dot {
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  background: #fbfff5;
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 rgba(39, 54, 48, 0.22);
  cursor: pointer;
}

.comic-dot.active {
  background: var(--deep);
}

.comic-caption {
  margin: 0;
  max-width: 44rem;
  font-weight: 800;
}

.back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 1200;
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  color: #fafff4;
  background: var(--deep);
  border: 3px solid var(--line);
  box-shadow: 5px 5px 0 rgba(39, 54, 48, 0.28);
  cursor: pointer;
  font: 900 1.8rem/1 var(--body);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.8rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

code {
  padding: 0.15rem 0.35rem;
  background: rgba(31, 122, 58, 0.13);
  border: 1px solid rgba(16, 32, 21, 0.18);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  color: #fafff4;
  background: var(--deep);
  border-top: 3px solid var(--line);
  font-weight: 900;
  text-transform: uppercase;
}

.site-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.icon-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  color: #fafff4;
  background: var(--deep);
  font-size: 1.2rem;
}

@media (max-width: 900px) {
  .hero,
  .content-block,
  .about-section {
    grid-template-columns: 1fr;
  }

  .comic-book {
    width: min(100%, 34rem);
  }

  .hero-media {
    min-height: 54svh;
  }

  .project-card,
  .project-card:nth-child(4n + 1),
  .project-card:nth-child(6n + 3) {
    grid-column: span 6;
  }

  .section-item {
    grid-template-columns: 1fr;
  }

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

  .studio-rail,
  .studio-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.55rem;
    font-size: 0.78rem;
  }

  .hero {
    min-height: auto;
    padding-top: 1rem;
  }

  .hero-media {
    min-height: auto;
    aspect-ratio: 16 / 9;
    background: #cce6ce;
  }

  .hero-media video {
    object-fit: contain;
    min-height: 0;
  }

  h1 {
    font-size: clamp(2.55rem, 15vw, 4.1rem);
  }

  .intro-strip {
    width: calc(100% - 2rem);
    grid-template-columns: 1fr;
  }

  .intro-strip div {
    border-right: 0;
    border-bottom: 2px solid var(--line);
  }

  .intro-strip div:last-child {
    border-bottom: 0;
  }

  .project-card,
  .project-card:nth-child(4n + 1),
  .project-card:nth-child(6n + 3) {
    grid-column: 1 / -1;
  }
}
