:root {
  color-scheme: light;
  --bg: #f4f3f0;
  --ink: #161616;
  --muted: #686866;
  --surface: rgba(255, 255, 255, 0.38);
  --surface-strong: rgba(255, 255, 255, 0.68);
  --line: rgba(22, 22, 22, 0.14);
  --line-soft: rgba(22, 22, 22, 0.09);
  --button: #1c1c1c;
  --button-ink: #ffffff;
  --glow: rgba(255, 255, 255, 0.9);
  --ambient: rgba(24, 26, 25, 0.2);
  --ambient-soft: rgba(30, 33, 31, 0.12);
  --glass-shine: rgba(255, 255, 255, 0.86);
  --glass-depth: rgba(24, 26, 25, 0.08);
  --shadow: 0 18px 48px rgba(24, 24, 24, 0.09);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0e0f;
  --ink: #f1f1ef;
  --muted: #aaaead;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.09);
  --button: #eeeeeb;
  --button-ink: #111313;
  --glow: rgba(255, 255, 255, 0.08);
  --ambient: rgba(255, 255, 255, 0.12);
  --ambient-soft: rgba(255, 255, 255, 0.06);
  --glass-shine: rgba(255, 255, 255, 0.17);
  --glass-depth: rgba(0, 0, 0, 0.28);
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Onest, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(ellipse at 50% 3%, var(--glow), transparent 34%),
    radial-gradient(ellipse at 94% 18%, var(--ambient), transparent 30%),
    radial-gradient(ellipse at 3% 48%, var(--ambient-soft), transparent 28%),
    radial-gradient(ellipse at 78% 82%, var(--ambient-soft), transparent 30%),
    var(--bg);
  background-attachment: fixed;
  transition: color 250ms ease, background-color 250ms ease;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.22;
  pointer-events: none;
  background-image: linear-gradient(115deg, transparent 35%, var(--glow) 50%, transparent 65%);
}
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
.container { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.glass {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 15% 0%, var(--glass-shine), transparent 34%),
    linear-gradient(135deg, var(--surface-strong), var(--surface) 54%, var(--surface-strong));
  box-shadow:
    var(--shadow),
    inset 0 1px 0 var(--glass-shine),
    inset 0 -10px 24px var(--glass-depth),
    inset 12px 0 26px color-mix(in srgb, var(--glass-shine) 18%, transparent);
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
}
.glass::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 58%;
  height: 180%;
  left: -30%;
  top: -76%;
  border-radius: 44% 56% 62% 38% / 38% 46% 54% 62%;
  background: radial-gradient(ellipse, var(--glass-shine), transparent 68%);
  filter: blur(22px);
  opacity: 0.3;
  transform: rotate(-12deg);
  pointer-events: none;
}
.glass::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 1px;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at 82% 4%, var(--glass-shine), transparent 25%),
    linear-gradient(105deg, transparent 16%, color-mix(in srgb, var(--glass-shine) 38%, transparent) 42%, transparent 62%);
  opacity: 0.3;
  pointer-events: none;
}
.glass > * { position: relative; z-index: 1; }

.nav {
  position: sticky;
  top: 14px;
  z-index: 20;
  width: min(1180px, calc(100% - 48px));
  min-height: 68px;
  margin: 14px auto 0;
  padding: 8px 10px 8px 26px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  overflow: visible;
}
.brand { font-family: Cinzel, Georgia, serif; font-size: 22px; font-weight: 600; letter-spacing: 0.01em; }
.nav-links { display: flex; align-items: center; gap: 34px; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-links a { transition: color 180ms ease; }
.nav-links a:hover { color: var(--ink); }
.nav-contact { display: none; }
.nav-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.theme-button, .menu-button { height: 42px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(145deg, var(--surface-strong), var(--surface)); box-shadow: inset 0 1px 0 var(--glass-shine), 0 8px 22px var(--glass-depth); backdrop-filter: blur(18px); cursor: pointer; }
.theme-button { width: 42px; font-size: 20px; line-height: 1; }
.menu-button { display: none; width: 42px; padding: 0; font-size: 21px; line-height: 1; }

.hero { min-height: 610px; padding: 115px 20px 95px; display: grid; place-items: center; text-align: center; }
.hero-copy { max-width: 920px; }
.label { margin: 0 0 22px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
h1, h2, h3 { font-family: Cinzel, Georgia, serif; font-weight: 500; text-wrap: balance; }
h1 { margin: 0; font-size: clamp(58px, 7.7vw, 104px); line-height: 0.9; letter-spacing: -0.045em; text-transform: uppercase; }
h1 span { display: block; color: inherit; }
.hero-text { max-width: 620px; margin: 35px auto 0; color: var(--muted); font-size: clamp(16px, 2vw, 20px); line-height: 1.6; }
.actions, .contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 34px; }
.button { position: relative; overflow: hidden; min-height: 48px; padding: 0 24px; border: 1px solid var(--line); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; box-shadow: inset 0 1px 0 var(--glass-shine), 0 12px 28px var(--glass-depth); backdrop-filter: blur(18px) saturate(140%); transition: transform 180ms ease, opacity 180ms ease; }
.button:hover { transform: translateY(-2px); }
.button.primary { color: var(--button-ink); background: var(--button); }
.button.secondary { background: linear-gradient(135deg, var(--surface-strong), var(--surface)); }
.button-icon { width: 19px; height: 19px; margin-right: 9px; object-fit: contain; }
:root:not([data-theme="dark"]) .button.primary {
  border-color: #262826;
  background: #1b1d1c;
  box-shadow: 0 8px 20px rgba(18, 20, 19, 0.16);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.stats { margin-bottom: 90px; padding: 20px 26px; border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: repeat(3, 1fr); background: radial-gradient(ellipse at 18% 0%, var(--glass-shine), transparent 42%), linear-gradient(135deg, var(--surface-strong), var(--surface)); box-shadow: var(--shadow), inset 0 1px 0 var(--glass-shine), inset 0 -10px 24px var(--glass-depth); backdrop-filter: blur(20px) saturate(125%); }
.stats article { min-height: 92px; display: flex; flex-direction: column-reverse; align-items: center; justify-content: center; gap: 6px; }
.stats article + article { border-left: 1px solid var(--line-soft); }
.stats span { color: var(--muted); font-size: 12px; }
.stats strong { font-family: Cinzel, Georgia, serif; font-size: clamp(38px, 5vw, 56px); font-weight: 500; line-height: 0.9; }

.portfolio { padding-block: 25px 82px; }
.section-heading { margin-bottom: 24px; }
.section-heading .label { margin-bottom: 8px; }
h2 { margin: 0; font-size: clamp(38px, 5vw, 58px); line-height: 1; letter-spacing: -0.025em; }
.horizontal-grid, .vertical-grid { display: grid; gap: 16px; }
.horizontal-grid { grid-template-columns: repeat(3, 1fr); }
.vertical-grid { grid-template-columns: repeat(4, 1fr); }
.project-card { padding: 8px 8px 18px; border-radius: 11px; box-shadow: none; transition: transform 180ms ease, background 180ms ease; }
.project-card:hover { transform: translateY(-3px); background: var(--surface-strong); }
.project-card h3 { margin: 16px 10px 5px; font-family: Cinzel, Georgia, serif; font-size: 14px; font-weight: 600; }
.project-card p { margin: 0 10px; color: var(--muted); font-size: 11px; }
.preview { position: relative; overflow: hidden; border: 1px solid color-mix(in srgb, var(--glass-shine) 55%, transparent); border-radius: 7px; background: linear-gradient(145deg, #d8d8d6, #6e716f); box-shadow: inset 0 1px 0 var(--glass-shine), inset 0 -20px 35px var(--glass-depth); filter: grayscale(1); }
html[data-theme="dark"] .preview { background: linear-gradient(145deg, #656766, #151718); }
.preview.wide { aspect-ratio: 16 / 9; }
.preview.tall { aspect-ratio: 9 / 14; }
.preview::before, .preview::after { content: ""; position: absolute; border-radius: 48% 52% 40% 60%; background: rgba(255,255,255,.38); transform: rotate(-28deg); }
.preview::before { width: 110%; height: 38%; left: -15%; top: 24%; }
.preview::after { width: 90%; height: 28%; right: -15%; bottom: 12%; background: rgba(20,20,20,.2); }
.preview span { position: absolute; top: 12px; left: 12px; z-index: 1; color: rgba(255,255,255,.75); font: 700 10px Onest, sans-serif; }
.preview button { position: absolute; left: 12px; bottom: 12px; z-index: 2; width: 34px; height: 34px; padding-left: 3px; border: 0; border-radius: 50%; color: #111; background: rgba(255,255,255,.86); cursor: pointer; }
.preview > img, .preview > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview.has-media::before, .preview.has-media::after { opacity: 0.12; }
.project-date { display: block; margin: 8px 10px 0; color: var(--muted); font-size: 10px; }

.about { margin-block: 28px 86px; padding: clamp(28px, 5vw, 58px); border-radius: 12px; }
.about .label { margin-bottom: 10px; }
.about h2 { max-width: 830px; }
.about-copy { margin-top: 38px; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.about-copy p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.about-actions { justify-content: flex-start; margin-top: 30px; }

.faq { padding-block: 20px 90px; }
.faq-list { overflow: hidden; border-radius: 11px; box-shadow: none; }
.faq-item + .faq-item { border-top: 1px solid var(--line-soft); }
.faq-question { width: 100%; min-height: 58px; padding: 0 18px; border: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; text-align: left; background: transparent; cursor: pointer; }
.faq-question b { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: 400; transition: transform 200ms ease; }
.faq-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 220ms ease; }
.faq-answer p { min-height: 0; overflow: hidden; margin: 0; padding: 0 58px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.faq-item.open .faq-answer { grid-template-rows: 1fr; }
.faq-item.open .faq-answer p { padding-bottom: 20px; }
.faq-item.open .faq-question b { transform: rotate(45deg); }

.contact { padding-block: 95px 110px; border-top: 1px solid var(--line-soft); text-align: center; }
.contact > div:first-child { max-width: 820px; margin-inline: auto; }
.contact .label { margin-bottom: 14px; }
.contact-links { margin-top: 28px; }

.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.99);
  transition:
    opacity 700ms cubic-bezier(.2,.75,.25,1),
    transform 700ms cubic-bezier(.2,.75,.25,1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: translateY(0) scale(1); }

.player-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; visibility: hidden; opacity: 0; transition: opacity 220ms ease, visibility 220ms ease; }
.player-modal.active { visibility: visible; opacity: 1; }
.player-overlay { position: absolute; inset: 0; border: 0; background: rgba(5, 6, 6, 0.78); cursor: pointer; backdrop-filter: blur(10px); }
.player-shell { width: min(1040px, 100%); padding: 10px; border-radius: 18px; background: rgba(18, 20, 19, 0.82); }
.player-stage { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 12px; background: #050606; }
.player-modal.vertical-mode .player-shell { width: min(460px, calc((100vh - 130px) * 0.5625), 100%); }
.player-modal.vertical-mode .player-stage { aspect-ratio: 9 / 16; }
.player-stage video { object-fit: contain; background: #050606; }
.player-stage video, .player-stage iframe, #youtubePlayer { width: 100%; height: 100%; border: 0; }
.player-modal:not(.youtube-mode) #youtubePlayer { display: none; }
.player-modal.youtube-mode #videoPlayer { display: none; }
.player-controls { padding: 10px 4px 2px; display: grid; grid-template-columns: 42px minmax(80px, 1fr) 42px; align-items: center; gap: 8px; }
.player-controls button { height: 40px; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; color: white; background: rgba(255,255,255,.07); cursor: pointer; }
#playPause { width: 42px; font-size: 17px; }
#closeBtn { width: 42px; }
.pause-icon { display: inline-flex; align-items: center; gap: 6px; }
.pause-icon i { width: 3px; height: 15px; border-radius: 2px; background: currentColor; }
.player-controls input { width: 100%; accent-color: #f1f1ef; }
body.player-open { overflow: hidden; }

@media (max-width: 900px) {
  .nav-links { gap: 18px; }
  .hero { min-height: 560px; padding-top: 100px; }
  .horizontal-grid { grid-template-columns: repeat(2, 1fr); }
  .horizontal-grid article:last-child { grid-column: span 2; }
  .vertical-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .container, .nav { width: min(100% - 24px, 1180px); }
  .nav { top: 8px; margin-top: 8px; padding-left: 18px; grid-template-columns: 1fr auto; }
  .menu-button { display: block; }
  .nav-links { position: absolute; top: 66px; left: 0; right: 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; display: none; flex-direction: column; align-items: stretch; gap: 2px; background: var(--bg); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .nav-contact { display: block; }
  .hero { min-height: auto; padding: 88px 6px 72px; }
  h1 { font-size: clamp(47px, 14vw, 68px); }
  .hero-text { margin-top: 25px; }
  .stats { margin-bottom: 62px; padding: 10px 4px; grid-template-columns: repeat(3, 1fr); }
  .stats article { min-width: 0; min-height: 70px; gap: 4px; }
  .stats article + article { border-left: 1px solid var(--line-soft); border-top: 0; }
  .stats strong { font-size: clamp(25px, 8vw, 34px); white-space: nowrap; }
  .stats span { font-size: 9px; }
  .portfolio { padding-bottom: 58px; }
  .horizontal-grid { grid-template-columns: 1fr; }
  .horizontal-grid article:last-child { grid-column: auto; }
  .vertical-grid { gap: 10px; }
  .project-card { padding: 6px 6px 14px; }
  .project-card h3 { margin: 12px 7px 4px; font-size: 12px; }
  .project-card p { margin-inline: 7px; font-size: 9px; }
  .about { margin-bottom: 62px; }
  .about-copy { grid-template-columns: 1fr; gap: 20px; }
  .faq { padding-bottom: 65px; }
  .contact { padding-block: 72px 82px; }
  .player-modal { padding: 10px; }
  .player-shell { padding: 6px; }
  .player-controls { grid-template-columns: 38px minmax(60px, 1fr) 38px; }
  #playPause { width: 38px; }
  #closeBtn { width: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
