/* Local fonts — self-hosted for DSGVO compliance */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/lato-300-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/lato-300-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/lato-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/lato-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/lato-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/lato-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/playfair-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/playfair-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/playfair-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/playfair-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/playfair-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/playfair-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html {
  font-size: 16px;
}

:root {
  --section-gap: 6rem;
  --accent: #ff9a72;
  --content-width: 1050px;
  --text-width: 700px;
  --heading-spacing: 0.2em;

  /* Type scale — smallest to largest */
  --font-nav: 0.8rem;
  --font-nav-hero: 0.75rem;
  --font-nav-menu: 0.85rem;
  --font-caption: 0.875rem;
  --font-nav-hero-desktop: 0.9rem;
  --font-heading: 1.0625rem;
  --font-subtitle: 1.1rem;
  --font-body: 1.125rem;
  --font-body-hero-desktop: 1.5rem;
  --font-subtitle-desktop: 1.8rem;
  --font-h1-mobile: 2.2rem;
  --font-h1-hero: 2.2rem;
  --font-h1: 3.5rem;
  --font-h1-hero-desktop: 5rem;
}

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

body {
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  color: #000;
  background: #fff;
  letter-spacing: 0.03em;
  overflow-x: hidden;
}

strong {
  font-weight: 700;
}

/* Sticky header */

header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 0.4rem 2rem;
  transition: box-shadow 0.3s;
}

/* On hero page: hidden until scrolled past hero (desktop only) */
.has-hero header {
  background: transparent;
  backdrop-filter: none;
}

.has-hero header:not(.header-light) .nav-links a {
  color: transparent;
  pointer-events: none;
}

.has-hero header:not(.header-light) .nav-logo {
  opacity: 0;
  pointer-events: none;
}

.has-hero header.header-light {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.08);
}

.has-hero header.header-light .nav-links a {
  color: #000;
  pointer-events: auto;
}

header.scrolled {
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.08);
}

nav {
  display: flex;
  align-items: center;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav a {
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: var(--font-nav);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}

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

.nav-logo {
  margin-left: auto;
  transition: opacity 0.3s;
}

.nav-logo img {
  height: 2rem;
  width: 2rem;
  object-fit: cover;
  border-radius: 4px;
}

.burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.burger span {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: #000;
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

.burger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.burger.open span:nth-child(2) {
  opacity: 0;
}

.burger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  background: var(--accent);
  color: #000;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top svg {
  width: 1.1rem;
  height: 1.1rem;
}

.back-to-top:hover {
  filter: brightness(0.88);
  transform: translateY(-2px);
  transition: opacity 0.3s, filter 0.2s, transform 0.2s;
}
/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* --vh-initial is set once by JS and updated only on width changes,
     avoiding jumps when Firefox mobile collapses the address bar.
     100svh fallback for when JS hasn't run yet. */
  min-height: var(--vh-initial, 100svh);
  margin-top: -3rem;
  padding: 0;
  background: #1a1a1a;
  max-width: 100%;
  overflow: hidden;
}

.hero-image {
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.hero-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.hero-content {
  background: #1a1a1a;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: 3rem 4rem;
  overflow-wrap: break-word;
  min-width: 0;
}

.hero-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-label {
  font-family: 'Lato', sans-serif;
  font-size: var(--font-heading);
  letter-spacing: var(--heading-spacing);
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 700;
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: var(--font-h1);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: var(--font-h1-hero);
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.hero-subtitle {
  font-family: 'Lato', sans-serif;
  font-size: var(--font-subtitle);
  font-style: italic;
  font-weight: 300;
  color: #cccccc;
  margin-bottom: 1.5rem;
}

.hero-intro {
  font-size: var(--font-body);
  line-height: 1.7;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.hero-intro strong {
  color: var(--accent);
  font-weight: 600;
}

.hero-nav {
  border-top: 1px solid #333;
  padding: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem clamp(1rem, 3vw, 2rem);
  margin-top: 2rem;
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
}

.hero-nav ul {
  display: contents;
  list-style: none;
}

.hero-nav a {
  color: #ffffff;
  text-decoration: none;
  font-family: 'Lato', sans-serif;
  font-size: var(--font-nav-hero);
  font-weight: 600;
  letter-spacing: var(--heading-spacing);
  text-transform: uppercase;
}

.hero-nav a:hover {
  color: var(--accent);
}

/* Shared heading style */

.portfolio-locked h2,
.skill-item h3,
#vita h2,
.vita-column h3,
footer h4,
.subpage-title,
.subpage-pair-text h3,
.project-info h3,
.legal-heading {
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: var(--font-heading);
  letter-spacing: var(--heading-spacing);
  text-transform: uppercase;
}

/* Main sections — shared layout */

#portfolio,
#skills,
#vita {
  padding: var(--section-gap) 2rem 0;
  max-width: var(--content-width);
  margin: 0 auto;
}

/* Project Grid */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.2rem;
  max-width: var(--content-width);
  margin: 0 auto;
}

.project {
  transition: transform 0.2s ease;
}

.project:hover {
  transform: scale(1.03);
}

.project img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.project-category {
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: var(--heading-spacing);
  text-transform: uppercase;
  margin-top: 0.75rem;
  text-align: center;
}

.project-title {
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: var(--heading-spacing);
  text-transform: uppercase;
  margin-top: 0.75rem;
  text-align: center;
}

.project-category + .project-title {
  margin-top: 0;
}

/* Portfolio locked placeholder */

.portfolio-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: var(--accent);
}

.portfolio-locked h2 {
  color: rgba(0, 0, 0, 0.75);
  margin-bottom: 1.5rem;
}

.lock-icon {
  width: 2rem;
  height: 2rem;
  color: #fff;
  stroke-width: 2;
  margin-bottom: 1rem;
}

.locked-text {
  font-family: 'Lato', sans-serif;
  font-size: var(--font-body);
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  color: rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
}

.locked-error {
  font-family: 'Lato', sans-serif;
  font-size: 0.8rem;
  color: #fff;
  margin-top: 1rem;
}

.locked-form {
  display: flex;
  gap: 0;
}

.locked-form input[type=password] {
  padding: 0.65rem 0.8rem;
  font-family: 'Lato', sans-serif;
  font-size: var(--font-body);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-right: none;
  outline: none;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.9);
}

.locked-form input[type=password]:focus {
  border-color: #000;
}

.locked-submit {
  background: #000;
  border: none;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.locked-submit svg {
  width: 1.2rem;
  height: 1.2rem;
  color: #fff;
}

.locked-submit:hover {
  filter: brightness(0.3);
}

/* Skills Section */

/* Skills Grid */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
  text-align: left;
}

.skill-item h3 {
  margin-bottom: 0.75rem;
}

.skill-item p {
  font-size: var(--font-body);
  line-height: 1.6;
}

.skill-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 1rem;
}

.skill-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Vita Section */

#vita h2 {
  margin-bottom: 2rem;
}

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

.vita-column h3 {
  margin-bottom: 1.5rem;
  margin-top: 2.5rem;
}

.vita-column h3:first-child {
  margin-top: 0;
}

/* CV Entries */

.cv-entry {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cv-date {
  font-size: var(--font-body);
  line-height: 1.5;
}

.cv-date a[href^="tel"] {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
}

.cv-details strong {
  font-weight: 700;
  font-size: var(--font-heading);
  display: block;
  margin-bottom: 0.15rem;
}

.cv-details p {
  font-size: var(--font-body);
  line-height: 1.4;
  margin-bottom: 0;
}

/* Footer */

footer {
  background: #1a1a1a;
  color: #fff;
  padding: 4rem 0;
  margin-top: var(--section-gap);
}

.footer-grid {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
}

footer h4 {
  margin-bottom: 1rem;
}

footer p {
  font-size: var(--font-body);
  line-height: 1.5;
}

footer a[href^="tel"],
footer a[href^="mailto"] {
  color: inherit;
  text-decoration: none;
}

.footer-contact {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.footer-spacer {
  flex: 1;
}

.footer-legal {
  color: #fff;
  text-decoration: none;
}
/* Subpage — Hero */

.subpage-hero {
  width: 100%;
  position: relative;
}

.subpage-hero img {
  width: 100%;
  display: block;
}

.subpage-hero video {
  width: 100%;
  display: block;
}

.subpage-hero.constrained {
  max-width: calc(var(--content-width) * 1.02);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Subpage — Content */

.subpage-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3.5rem 2rem 2rem;
}

.subpage-content-hero {
  padding-top: 5rem;
  padding-bottom: 3rem;
}

.subpage-title {
  line-height: normal;
  margin-bottom: 1.5rem;
  max-width: var(--text-width);
  margin-left: auto;
  margin-right: auto;
}

.subpage-title-project {
  font-weight: 400;
}

.subpage-pair-reverse .subpage-pair-text {
  order: -1;
}
.subpage-content p {
  font-size: var(--font-body);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: var(--text-width);
  margin-left: auto;
  margin-right: auto;
}

.subpage-content p.spaced {
  margin-bottom: 3.5rem;
}

.subpage-content-hero p {
  margin-bottom: 3rem;
}

/* Subpage — Image Grid (2x2) */

.subpage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 3.5rem 0;
}

.subpage-grid img,
.subpage-grid-3 img {
  width: 100%;
  display: block;
  object-fit: cover;
}

/* Subpage — Image Grid (3 columns) */

.subpage-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin: 3.5rem 0;
}

/* Subpage — Wide Image */

.subpage-wide-image {
  margin: 2rem 0;
}

.subpage-wide-image img {
  width: 100%;
  display: block;
}

.image-caption {
  font-size: var(--font-caption);
  color: #666;
  text-align: center;
  margin-top: 0.5rem;
}

/* Subpage — Video */

.subpage-video {
  margin: 3rem 0;
  display: flex;
  justify-content: center;
}

.subpage-video-inner {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.subpage-video video {
  display: block;
  max-width: 100%;
  cursor: pointer;
  min-height: 80vh;
  max-height: 90vh;
}

.video-controls {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 5;
}

.video-controls-tr {
  top: 1rem;
  right: 1rem;
  align-items: flex-end;
}

.video-controls-bl {
  bottom: 1rem;
  right: 1rem;
  align-items: flex-end;
}

.video-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  background: transparent;
  cursor: pointer;
}

.video-volume::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.3);
  height: 3px;
  border-radius: 2px;
}

.video-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  margin-top: -5.5px;
}

.video-volume::-moz-range-track {
  background: rgba(255, 255, 255, 0.3);
  height: 3px;
  border-radius: 2px;
}

.video-volume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: none;
}

.no-audio .video-mute-group {
  display: none;
}

.video-mute-group {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.5rem;
}

.video-mute-group .video-volume {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 1rem;
  padding: 0.4rem 0.5rem;
}

.video-mute-group:hover .video-volume {
  opacity: 1;
  pointer-events: auto;
}

.video-btn {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.video-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}

.video-btn svg {
  width: 1.3rem;
  height: 1.3rem;
  display: none;
}

.video-play-btn .icon-pause {
  display: block;
}

.video-play-btn.paused .icon-pause {
  display: none;
}

.video-play-btn.paused .icon-play {
  display: block;
}

.video-mute-btn.muted .icon-muted {
  display: block;
}

.video-mute-btn:not(.muted) .icon-unmuted {
  display: block;
}

.video-fullscreen-btn svg {
  display: block;
}

.video-mute-btn.muted {
  animation: pulse-mute 2s ease-in-out 3;
}

@keyframes pulse-mute {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.video-close-btn {
  display: none;
}

:is(.subpage-video, .subpage-hero):fullscreen .video-close-btn {
  display: block;
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

:is(.subpage-video, .subpage-hero):fullscreen .video-close-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}

:is(.subpage-video, .subpage-hero):fullscreen .video-fullscreen-btn {
  display: none;
}

:is(.subpage-video, .subpage-hero):fullscreen {
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

:is(.subpage-video, .subpage-hero):fullscreen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-height: 0;
  max-height: none;
}

:is(.subpage-video, .subpage-hero):fullscreen .video-controls {
  position: fixed;
  z-index: 10;
}

:is(.subpage-video, .subpage-hero):fullscreen .video-controls-tr {
  top: 2rem;
  right: 2rem;
}

:is(.subpage-video, .subpage-hero):fullscreen .video-timeline {
  position: fixed;
  bottom: 1.5rem;
  left: 2rem;
  right: 2rem;
  z-index: 10;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

:is(.subpage-video, .subpage-hero):fullscreen .video-timeline-fill {
  background: rgba(255, 255, 255, 0.6);
}

:is(.subpage-video, .subpage-hero):fullscreen .video-timeline-fill::after {
  background: rgba(255, 255, 255, 0.8);
}

:is(.subpage-video, .subpage-hero):fullscreen .video-controls-bl {
  bottom: 2rem;
  right: 2rem;
}

/* Video Timeline */

.video-timeline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: height 0.15s;
  z-index: 10;
}

.video-timeline::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  bottom: 0;
}

.video-timeline:hover {
  height: 8px;
}

.video-timeline-fill {
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  width: 0%;
  pointer-events: none;
  position: relative;
}

.video-timeline-fill::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  transition: transform 0.15s;
}

.video-timeline:hover .video-timeline-fill::after {
  transform: translateY(-50%) scale(1);
}

/* Subpage — Paired Image+Text sections */

.subpage-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-top: 5rem;
  margin-bottom: 5rem;
}

.subpage-pair img {
  width: 100%;
  display: block;
}

.subpage-pair-text h3 {
  margin-bottom: 0.75rem;
}

.subpage-pair-text p {
  font-size: var(--font-body);
  line-height: 1.7;
}

/* Subpage — Project Info */

.project-info {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 2rem 0;
}

.project-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  border-top: 1px solid #ddd;
  padding-top: 2rem;
  max-width: var(--text-width);
  margin-left: auto;
  margin-right: auto;
}

.project-info h3 {
  margin-bottom: 0.75rem;
}

.project-info p,
.project-info li {
  font-size: var(--font-body);
  line-height: 1.6;
}

.project-info ul {
  list-style: none;
}

/* Login page */

.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 2rem;
}

.login-page {
  text-align: center;
}

.login-page h1 {
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: var(--font-heading);
  letter-spacing: var(--heading-spacing);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.login-page .locked-text {
  color: #888;
  margin-bottom: 1.5rem;
}

.login-page .locked-form {
  justify-content: center;
}

.login-page .lock-icon {
  color: #999;
}

/* Impressum / Legal */

.legal-heading {
  max-width: var(--text-width);
  margin-top: 2rem;
  margin-right: auto;
  margin-bottom: 0.75rem;
  margin-left: auto;
}

.legal-separator {
  border: none;
  border-top: 1px solid #ddd;
  max-width: var(--text-width);
  margin: 3rem auto;
}

.legal-content a {
  color: inherit;
  text-decoration: none;
}

/* Lightbox */

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 200;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 82vh;
  object-fit: contain;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.lightbox-close:hover {
  opacity: 0.7;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Lato', sans-serif;
  font-size: var(--font-caption);
  letter-spacing: 0.05em;
  margin-top: 1rem;
  text-align: center;
  max-width: 90%;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 1rem;
  user-select: none;
  z-index: 1;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
  color: #fff;
}

.zoomable {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.zoomable img {
  display: block;
  width: 100%;
}

.zoom-icon {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.zoom-icon svg {
  width: 1rem;
  height: 1rem;
}

.zoomable:hover .zoom-icon {
  opacity: 1;
}

/* Screen-reader only */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Nav list reset */

.nav-links {
  list-style: none;
}

/* Project card links */

.project a {
  text-decoration: none;
  color: inherit;
}

/* Responsive */

/* Desktop hero: larger text to fill the side-by-side layout */
@media (min-width: 1025px) and (min-height: 900px) {
  .hero h1 {
    font-size: var(--font-h1-hero-desktop);
  }

  .hero-subtitle {
    font-size: var(--font-subtitle-desktop);
  }

  .hero-intro {
    font-size: var(--font-body-hero-desktop);
  }

  .hero-nav a {
    font-size: var(--font-nav-hero-desktop);
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .hero-nav {
    flex-wrap: wrap;
    gap: 0 clamp(0.5rem, 1.5vw, 1.5rem);
  }

  .hero-nav a {
    font-size: clamp(0.55rem, 1.8vw, 0.75rem);
    letter-spacing: 0.1em;
  }

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

/* Stack hero vertically on narrow/portrait screens */
@media (max-width: 768px), ((max-width: 1024px) and (orientation: portrait)) {
  .hero {
    display: flex;
    flex-direction: column;
    min-height: var(--vh-initial, 100svh);
    overflow: hidden;
  }

  .hero-image {
    flex: 1 0 auto;
    width: 100%;
    aspect-ratio: 961 / 600;
    overflow: hidden;
  }

  .hero-content {
    flex: 0 0 auto;
    padding: 2rem;
    align-items: stretch;
    text-align: left;
  }

  .hero-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.75rem 1.5rem;
    width: 100%;
    padding: 1rem 0 0;
    margin: 1.5rem 0 0;
    border: none;
    border-top: 1px solid #333;
  }

  .hero-nav a {
    font-size: var(--font-nav-hero);
    letter-spacing: 0.1em;
    padding: 0;
    margin: 0;
  }

  .subpage-hero {
    overflow: hidden;
  }

  .subpage-hero:not(.no-zoom) img {
    transform: scale(var(--mobile-zoom, 1.15));
  }
}

/* Mobile */
@media (max-width: 768px) {
  .back-to-top {
    width: 2.8rem;
    height: 2.8rem;
    min-width: 2.8rem;
    min-height: 2.8rem;
    font-size: 1.5rem;
  }

  .project-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 500px;
  }

  .skills-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .vita-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .footer-grid {
    padding: 0;
  }

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

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

  .project-info-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .subpage-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .subpage-pair-reverse .subpage-pair-text {
    order: 0;
  }

  .subpage-hero.constrained {
    padding: 0 2rem;
  }

  .video-controls-tr {
    top: 0.5rem;
    right: 0.5rem;
  }

  .video-controls-bl {
    bottom: 0.5rem;
    right: 0.5rem;
  }

  .video-btn {
    width: 2.5rem;
    height: 2.5rem;
  }

  .subpage-content {
    padding: 2rem;
  }

  .subpage-content p {
    font-size: var(--font-body);
  }

  .cv-entry {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }

  h1 {
    font-size: var(--font-h1-mobile);
  }

  footer {
    padding: 3rem 2rem 2rem;
  }

  .footer-grid {
    padding: 0;
  }

  .footer-contact {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .footer-dot {
    display: none;
  }

  .footer-spacer {
    display: none;
  }

  .footer-legal {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  header {
    padding: 0.6rem 0;
  }

  nav {
    justify-content: space-between;
    padding: 0 2rem;
  }

  .burger {
    display: block;
    padding: 0.3rem 0;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 0.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.4rem 1.5rem;
    font-size: var(--font-nav-menu);
  }

  .hero-image img {
    object-position: 20% 10%;
  }

  .hero-content {
    padding: 2rem;
  }

  .has-hero header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
  }

  .has-hero header:not(.header-light) .nav-logo {
    opacity: 1;
    pointer-events: auto;
  }

  .has-hero header:not(.header-light) .nav-links a {
    color: #000;
    pointer-events: auto;
  }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
