:root {
  --bg: #ffffff;
  --ink: #0b0b0b;
  --muted: #5c5c5c;
  --line: #171717;
  --line-soft: #d8d8d8;
  --red: #ff0000;
  --red-dark: #8f0d1e;
  --soft: #f7f7f7;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.16);
  --font-body: "Space Grotesk", Arial, Helvetica, sans-serif;
  --font-display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --page-x: clamp(18px, 5vw, 64px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
 /* background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 100px 100px, 100px 100px, auto;*/
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;

}

body.modal-open {
  overflow: hidden;
}


header, main, footer{
  max-width: 2200px;
  margin: auto;
}
.top-anchor {
  position: absolute;
  top: 0;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
}

.site-header {
  /*position: sticky;*/
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px var(--page-x);
  background: rgba(255, 255, 255, 1);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.top-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  margin-left: -1px;

}



nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

nav a {
  position: relative;
  text-decoration: none;
}

nav a::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 1px;
  background: var(--red);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

nav a:hover,
nav a:focus-visible,
.text-link:hover,
.text-link:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--red);
}

nav a:hover::after,
nav a:focus-visible::after {
  transform: scaleX(1);
}

.hero,
.section {
  padding: clamp(54px, 15vw, 160px) var(--page-x);
}

.hero {
  position: relative;
  min-height: calc(100svh - 83px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  align-items: start;
  gap: clamp(32px, 6vw, 84px);
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.hero::before {
  position: absolute;
  right: var(--page-x);
  bottom: clamp(24px, 5vw, 62px);
  z-index: -1;
  color: rgba(255, 0, 0, 0.08);
  content: "gabordelarosa";
  font-family: var(--font-display);
  font-size: clamp(8rem, 15vw, 20rem);
  line-height: 0.76;
  text-transform: uppercase;
}

.hero::after {
  position: absolute;
  left: var(--page-x);
  bottom: clamp(28px, 5vw, 72px);
  width: min(30vw, 360px);
  height: 2px;
  height: 4.5px;
  background: var(--red);
  content: "";
}

.hero-copy {
  position: relative;
  max-width: 850px;
}



.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 10ch;
  font-family: var(--font-display);
  font-size: clamp(6rem, 18vw, 16rem);
  line-height: 0.78;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.7rem, 10vw, 9.5rem);
  line-height: 0.78;
  letter-spacing: 0;
  text-transform: uppercase;
}

h3 {
  margin: 16px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
  font-weight: 400;
}

.hero-copy p:not(.eyebrow) {
  max-width: 760px;
  margin: 24px 0;
  color: var(--ink);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  font-weight: 500;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 7px;
}

.intro-panel {
  position: relative;
  display: grid;
  gap: 22px;
  padding: clamp(24px, 4vw, 38px);
  background: var(--ink);
  color: #fff;
  border-left: 4px solid var(--red);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

.intro-panel span {
  color: #f0f0f0;
}

.intro-panel strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 400;
  line-height: 0.95;
}
.intro-panel   .cubeinfo h3 {
    margin: 0;
    line-height: 0.8;

}
.intro-panel  .cubeinfo {
    margin-top: clamp(24px, 4vw, 38px);
}

#3dcube{width:310px; height: 310px; margin:auto;}



.section-heading {
  display: grid;
  gap: 10px;
  max-width: 980px;
  margin-bottom: clamp(18px, 3vw, 34px);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(10px, 1.4vw, 16px);
  width: 100%;
}

.portfolio-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(14px, 3vw, 28px);
  align-items: start;
  padding-block: clamp(34px, 7vw, 88px);
  border-top: 1px solid var(--line-soft);
}

.portfolio-section p {
  margin: 0;
}

.portfolio-section:first-of-type {
  padding-top: 0;
  border-top: none;
}

.portfolio-section h2 {
  position: relative;
  display: inline-block;
  padding-top: 14px;
  border-top: 0;
}

.portfolio-section h2::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  height: 4.5px;
  background: var(--red);
  content: "";
}

.work-card {
  position: relative;
  min-width: 0;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.work-card::before,
.work-card::after {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.work-card::before {
  content: "";
  background:
    linear-gradient(135deg, rgba(255, 0, 0, 0.82) 0 34%, rgba(0, 0, 0, 0.88) 34% 100%);
  z-index: 1;
}

.work-card::after {
  content: attr(data-title);
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.5vw, 1.5rem);
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
}

.work-card:hover,
.work-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--red);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14);
  outline: none;
}

.work-card:hover::before,
.work-card:hover::after,
.work-card:focus-visible::before,
.work-card:focus-visible::after {
  opacity: 1;
}

.work-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
 /* filter: grayscale(1) contrast(1.15);*/
  object-fit: cover;
  /*transition: filter 180ms ease, transform 180ms ease;*/
}

.work-card:hover img,
.work-card:focus-visible img {
  filter: grayscale(0) contrast(1.05);
  transform: scale(1.04);
}

.work-card strong {
  display: block;
  padding-inline: 12px;
}

.work-card strong {
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 400;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px var(--page-x);
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--ink);
  font-weight: 800;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  padding: clamp(8px, 1.5vw, 18px);
}

.modal.is-open {
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1680px, 100%);
  height: min(1120px, calc(100svh - clamp(16px, 3vw, 36px)));
  max-height: calc(100svh - clamp(16px, 3vw, 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(12px, 2vw, 18px);
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  outline: none;
}

.media-frame {
  min-height: 240px;
  display: grid;
  place-items: center;
 /* padding: clamp(8px, 1.5vw, 16px);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.055) 1px, transparent 1px),
    #f5f5f5;
  background-size: 36px 36px;*/
  overflow: auto;
}

.media-frame img,
.media-frame video,
.media-frame iframe {
  width: min(100%, 1480px);
  max-height: min(82svh, 940px);
  background: #000;
  border: 0;
  object-fit: contain;
}

.media-frame iframe {
  aspect-ratio: 16 / 9;
  height: auto;
}

.media-frame video {
  aspect-ratio: 16 / 9;
}

.modal-footer {
  border-top: 1px solid var(--line);
}

.restart-button {
  display: inline-flex;
  align-items: center;
  text-align: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.restart-button[hidden] {
  /*display: none;*/
  visibility: hidden;
}

.restart-button:hover,
.restart-button:focus-visible {
  background-color: var(--red);
  color:  #fff;
  outline: none;
  border-color: var(--red);
}



.modal-footer p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.pager[hidden] {
  visibility: hidden;
}

#pager-count {
  min-width: 54px;
  text-align: center;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

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

  .hero {
    align-items: start;
  }

  .intro-panel{
    text-align: center;
  }
  #myr3d-scale-container {
    margin: auto;
  }

}

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

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

  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro-panel {
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
  }

  .modal {
    padding: 0;
  }

  .modal-dialog {
    width: 100%;
    min-height: 100svh;
    max-height: 100svh;
  }

  .modal-header {
    flex-direction: row;
    align-items: center;
  }

  .modal-footer {
    gap: 14px;
  }
 .top-link {
    margin: auto;
  }
}
