:root {
  --black: #050505;
  --charcoal: #111111;
  --ink: #050505;
  --muted: #6c6c6c;
  --paper: #f4f2ed;
  --white: #ffffff;
  --accent: #24d8ff;
  --accent-2: #b66cff;
  --accent-3: #ff3fa4;
  --button-bg: #24d8ff;
  --button-hover: #ff3fa4;
  --button-text: #050505;
  --micro-accent: #d4f21b;
  --accent-soft: rgba(36, 216, 255, 0.14);
  --accent-line: rgba(182, 108, 255, 0.32);
  --accent-gradient: linear-gradient(135deg, #24d8ff 0%, #b66cff 46%, #ff3fa4 100%);
  --acid: var(--accent);
  --line: rgba(0, 0, 0, 0.12);
  --light-line: rgba(255, 255, 255, 0.16);
}

body[data-theme="nocturne"] {
  --accent: #26f2ff;
  --accent-2: #7c5cff;
  --accent-3: #ff4bd8;
  --button-bg: #26f2ff;
  --button-hover: #7c5cff;
  --button-text: #050505;
  --micro-accent: #d4f21b;
  --accent-soft: rgba(38, 242, 255, 0.12);
  --accent-line: rgba(124, 92, 255, 0.36);
  --accent-gradient: linear-gradient(135deg, #26f2ff 0%, #7c5cff 48%, #ff4bd8 100%);
  --paper: #f2f0f8;
}

body[data-theme="velvet"] {
  --accent: #58e4ff;
  --accent-2: #d17cff;
  --accent-3: #ff2f8f;
  --button-bg: #ff2f8f;
  --button-hover: #d17cff;
  --button-text: #ffffff;
  --micro-accent: #d4f21b;
  --accent-soft: rgba(255, 47, 143, 0.12);
  --accent-line: rgba(209, 124, 255, 0.34);
  --accent-gradient: linear-gradient(135deg, #58e4ff 0%, #d17cff 42%, #ff2f8f 100%);
  --paper: #f7f1f6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--ink);
  font-family: Lato, "Segoe UI", Arial, sans-serif;
  line-height: 1.625;
}

a {
  color: inherit;
}

.cursor-line {
  position: fixed;
  inset: 0 auto 0 50%;
  width: 1px;
  background: var(--accent-soft);
  pointer-events: none;
  z-index: 1;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 180px 1fr 46px;
  align-items: center;
  gap: 24px;
  padding: 24px 38px;
  color: var(--white);
  mix-blend-mode: difference;
}

.brand {
  font-family: Karla, "Segoe UI", Arial, sans-serif;
  color: var(--white);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.brand span {
  color: var(--accent-3);
}

.top-contact {
  display: flex;
  justify-content: center;
  gap: 38px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
}

.top-contact a {
  text-decoration: none;
}

.menu-button,
.close-menu {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.menu-button {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.menu-button span {
  display: block;
  width: 28px;
  height: 2px;
  background: currentColor;
}

.side-footer {
  position: fixed;
  left: 38px;
  bottom: 28px;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  gap: 34px;
  color: var(--white);
  mix-blend-mode: difference;
}

.socials {
  display: flex;
  gap: 16px;
}

.socials a,
.side-footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.overlay-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  background: rgba(5, 5, 5, 0.96);
  color: var(--white);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.overlay-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.overlay-menu a {
  font-family: Karla, "Segoe UI", Arial, sans-serif;
  color: var(--white);
  font-size: clamp(34px, 6vw, 82px);
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.overlay-menu a:hover {
  color: var(--accent-2);
}

.close-menu {
  position: absolute;
  top: 28px;
  right: 38px;
  font-size: 56px;
  line-height: 1;
}

.panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 104px 0;
}

.panel.dark {
  background: var(--black);
  color: var(--white);
}

.panel.light {
  background: var(--paper);
  color: var(--ink);
}

.panel-inner {
  position: relative;
  z-index: 2;
  width: min(1140px, calc(100% - 96px));
  margin: 0 auto;
}

.hero-bg,
.shade {
  position: absolute;
  inset: 0;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.18) contrast(1.04);
}

.shade {
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.78), rgba(5, 5, 5, 0.28)),
    linear-gradient(0deg, rgba(5, 5, 5, 0.68), rgba(5, 5, 5, 0.08));
}

.hero-grid,
.two-col,
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.62fr);
  gap: clamp(38px, 7vw, 96px);
  align-items: center;
}

.overline {
  margin: 0 0 18px;
  color: var(--micro-accent);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-title .overline,
.light .overline,
.contact-panel .overline {
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Karla, "Segoe UI", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  color: var(--white);
  font-size: clamp(58px, 8vw, 116px);
  line-height: 0.98;
}

h1 span {
  color: var(--accent-3);
}

h2 {
  max-width: 820px;
  color: inherit;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.06;
}

h3 {
  color: inherit;
  font-size: 28px;
  line-height: 1.15;
}

.accent-line {
  width: 86px;
  height: 4px;
  margin: 32px 0;
  background: var(--accent-gradient);
}

.lead {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(22px, 2.8vw, 34px);
  font-weight: 800;
  line-height: 1.18;
}

.hero-card {
  align-self: end;
  padding: 34px;
  border: 1px solid var(--light-line);
  background: rgba(5, 5, 5, 0.56);
  backdrop-filter: blur(14px);
}

.hero-card p,
.hero-card span {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  text-transform: uppercase;
}

.hero-card strong {
  display: block;
  margin: 14px 0 0;
  color: transparent;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  font-family: Karla, "Segoe UI", Arial, sans-serif;
  font-size: 56px;
  line-height: 1;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  padding: 14px 24px;
  border: 1px solid var(--button-bg);
  border-radius: 12px;
  background: var(--button-bg);
  color: var(--button-text);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.button:hover {
  border-color: var(--button-hover);
  background: var(--button-hover);
  transform: translateY(-1px);
}

.numbered-list {
  margin-top: 44px;
}

.numbered-list p {
  margin: 0;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.profile-visual {
  position: relative;
}

.profile-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.experience-badge {
  position: absolute;
  left: -44px;
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  background: var(--accent-gradient);
  color: #000;
}

.experience-badge strong {
  font-family: Karla, "Segoe UI", Arial, sans-serif;
  font-size: 58px;
  line-height: 0.9;
}

.experience-badge span {
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.compact-panel {
  min-height: auto;
}

.section-title {
  margin-bottom: 42px;
}

.row-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.46fr);
  gap: 40px;
  align-items: end;
}

.row-title > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
}

.light .row-title > p {
  color: var(--muted);
}

.timeline,
.press-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.timeline article {
  border-top: 1px solid var(--light-line);
  padding-top: 22px;
}

.timeline img,
.press-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin-bottom: 20px;
}

.timeline span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.timeline p {
  color: rgba(255, 255, 255, 0.7);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.link-card {
  min-height: 178px;
  display: grid;
  align-content: space-between;
  padding: 26px;
  background: #fff;
}

.link-card.has-media {
  min-height: 310px;
  padding: 0;
  overflow: hidden;
}

.link-card.has-media > div,
.link-card.has-media > a:not(.video-thumb) {
  margin-left: 22px;
  margin-right: 22px;
}

.link-card.has-media > div {
  margin-top: 18px;
}

.link-card.has-media > a:not(.video-thumb) {
  margin-bottom: 22px;
}

.video-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
}

.video-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 0.35s ease, filter 0.35s ease;
}

.video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.38));
}

.video-thumb:hover img {
  filter: saturate(1.12) contrast(1.06);
  transform: scale(1.045);
}

.play-mark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  display: inline-flex;
  width: 68px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #ff1744;
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
}

.video-thumb .play-mark {
  color: #ffffff;
}

.play-mark::before {
  content: none;
}

.play-mark svg {
  display: block;
  width: 31px;
  height: 31px;
  margin-left: 3px;
  fill: currentColor;
}

.link-card strong {
  display: block;
  color: #000;
  font-family: Karla, "Segoe UI", Arial, sans-serif;
  font-size: 23px;
  line-height: 1.08;
}

.link-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.video-thumb .play-mark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  width: 68px;
  height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  border-radius: 12px;
  background: #ff1744;
  color: #ffffff;
}

.video-thumb .play-mark svg {
  width: 31px;
  height: 31px;
  margin-left: 2px;
}

.link-card a {
  width: fit-content;
  color: #000;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration-color: var(--accent-2);
  text-decoration-thickness: 3px;
  text-transform: uppercase;
}

.link-card > a:not(.video-thumb) {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid var(--button-bg);
  border-radius: 999px;
  background: transparent;
  color: #000;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.link-card > a:not(.video-thumb):hover {
  border-color: var(--button-bg);
  background: var(--button-bg);
  color: var(--button-text);
}

.compact .link-card {
  min-height: 130px;
}

.inverted {
  background: var(--light-line);
  border-color: var(--light-line);
}

.inverted .link-card {
  background: #171717;
}

.theme-dock {
  position: fixed;
  right: 38px;
  bottom: 28px;
  z-index: 25;
  display: flex;
  gap: 8px;
  mix-blend-mode: difference;
}

.theme-dock button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 9px 11px;
  text-transform: uppercase;
}

.theme-dock button.is-active {
  border-color: var(--button-bg);
  background: var(--button-bg);
  color: var(--button-text);
}

.inverted .link-card strong,
.inverted .link-card a {
  color: #fff;
}

.inverted .link-card > a:not(.video-thumb) {
  border-color: var(--button-bg);
  color: #fff;
}

.inverted .link-card > a:not(.video-thumb):hover {
  color: var(--button-text);
}

.press-grid {
  margin-bottom: 34px;
}

.press-grid figure {
  margin: 0;
}

.press-grid figcaption {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-card {
  display: grid;
  gap: 18px;
  padding: 34px;
  border: 1px solid var(--light-line);
  background: #151515;
}

.contact-card a:not(.button),
.contact-card span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  text-decoration: none;
}

@media (max-width: 960px) {
  .topbar {
    grid-template-columns: 1fr 46px;
    padding: 20px;
    mix-blend-mode: normal;
    background: rgba(5, 5, 5, 0.88);
  }

  .top-contact,
  .side-footer {
    display: none;
  }

  .theme-dock {
    right: 20px;
    bottom: 16px;
    gap: 6px;
    mix-blend-mode: normal;
  }

  .theme-dock button {
    padding: 8px 9px;
    background: rgba(5, 5, 5, 0.74);
  }

  .panel {
    min-height: auto;
    padding: 96px 0 72px;
  }

  .panel-inner {
    width: min(100% - 40px, 640px);
  }

  .hero-grid,
  .two-col,
  .contact-grid,
  .row-title,
  .timeline,
  .press-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(50px, 15vw, 76px);
  }

  h2 {
    font-size: clamp(34px, 11vw, 54px);
  }

  .experience-badge {
    left: 18px;
  }
}

@media (max-height: 760px) {
  .side-footer {
    display: none;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html,
  body {
    background: var(--black);
    width: 210mm;
    margin: 0;
  }

  .topbar,
  .side-footer,
  .theme-dock,
  .overlay-menu,
  .cursor-line {
    display: none !important;
  }

  .panel {
    display: block;
    min-height: auto;
    box-sizing: border-box;
    page-break-after: always;
    break-after: page;
    overflow: visible;
    padding: 16mm 0;
  }

  .panel:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .hero,
  #perfil,
  .contact-panel {
    display: flex;
    min-height: 297mm;
    align-items: center;
  }

  .panel-inner {
    width: calc(100% - 22mm);
  }

  .hero-grid,
  .two-col,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr) minmax(58mm, 0.54fr);
    gap: 12mm;
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr) 88mm;
    gap: 8mm;
  }

  h1 {
    font-size: 58pt;
  }

  h2 {
    font-size: 32pt;
  }

  h3 {
    font-size: 18pt;
  }

  .lead {
    font-size: 20pt;
  }

  .hero-card {
    padding: 9mm;
  }

  .hero-card strong {
    font-size: 42pt;
  }

  .profile-visual img {
    max-height: 178mm;
  }

  .experience-badge {
    left: -8mm;
    bottom: 10mm;
  }

  .section-title {
    margin-bottom: 10mm;
  }

  .row-title {
    grid-template-columns: minmax(0, 1fr) minmax(52mm, 0.44fr);
    gap: 10mm;
  }

  .timeline,
  .press-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35mm;
  }

  .press-panel .project-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .link-card.has-media {
    min-height: auto;
  }

  .link-card {
    min-height: 44mm;
    break-inside: avoid;
    page-break-inside: avoid;
    padding: 6mm;
  }

  .link-card.has-media > div,
  .link-card.has-media > a:not(.video-thumb) {
    margin-left: 5mm;
    margin-right: 5mm;
  }

  .link-card.has-media > div {
    margin-top: 4mm;
  }

  .link-card.has-media > a:not(.video-thumb) {
    margin-bottom: 5mm;
  }

  .link-card strong {
    font-size: 15pt;
  }

  .link-card span {
    font-size: 9.5pt;
  }

  .video-thumb .play-mark {
    right: 4mm;
    bottom: 4mm;
    width: 15mm;
    height: 10.5mm;
    border-radius: 3mm;
  }

  .video-thumb .play-mark svg {
    width: 7mm;
    height: 7mm;
  }

  .timeline article,
  .press-grid figure {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .timeline img,
  .press-grid img {
    margin-bottom: 5mm;
  }

  .contact-card {
    padding: 7mm;
  }

  .contact-card a:not(.button),
  .contact-card span {
    font-size: 11.5pt;
  }

  .contact-card .button {
    width: 100%;
    box-sizing: border-box;
    padding-right: 4mm;
    padding-left: 4mm;
    font-size: 9.5pt;
    letter-spacing: 0.08em;
    text-align: center;
  }
}
