:root {
  --bg: #0f0f0f;
  --fg: #f5f2e8;
  --muted: #cec3b0;
  --accent: #ca5f2b;
  --card: #171717;
  --topbar-size: 0.84rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  background: var(--bg);
  color: var(--fg);
}

.topbar {
  position: fixed;
  top: 18px;
  left: 25px;
  right: 25px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.topbar a,
.topbar button {
  pointer-events: auto;
}

.home-link {
  color: #f5f2e8;
  text-decoration: none;
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  letter-spacing: 0.03em;
  font-weight: 500;
  z-index: 2;
}

.home-link:hover {
  text-decoration: underline;
}

.topbar-track {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #f5f2e8;
  font-size: var(--topbar-size);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 400;
  pointer-events: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2;
}

.clock-label {
  font-size: var(--topbar-size);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f5f2e8;
  font-weight: 400;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: #f5f2e8;
  cursor: pointer;
  padding: 0;
  font-size: var(--topbar-size);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 400;
}

.lang-btn:hover,
.lang-btn.active {
  text-decoration: underline;
}

.curtain-root {
  position: relative;
  height: 200vh;
  background: #181818;
}

.panel {
  min-height: 100vh;
}

.choice-panel {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hero-panel {
  position: fixed;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at 22% 30%, #4f1e14 0%, #2b1511 33%, #161212 80%);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  will-change: transform;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.08));
}

.hero-content {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  z-index: 3;
}

.hero-content h1 {
  margin: 0;
  text-transform: uppercase;
  font-size: clamp(1.2rem, 2.2vw, 2.2rem);
  letter-spacing: 0.08em;
}

.hero-subtitle-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 60px;
  margin: 0;
  color: #f5f2e8;
  font-size: var(--topbar-size);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 400;
  z-index: 3;
}

.choice-card {
  position: relative;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: #f5f2e8;
  background-size: cover;
  background-position: center;
  transition: transform 180ms ease, filter 180ms ease;
}

.choice-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.18));
}

.choice-card span {
  z-index: 1;
  text-align: center;
  padding: 0 20px;
  font-size: calc(var(--topbar-size) * 1.2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 400;
}

.choice-card:hover {
  filter: contrast(1.1) brightness(1.06);
  transform: scale(1.01);
}

.choice-card:hover span {
  text-decoration: underline;
}

.left-card {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.noise-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 200ms ease;
}

.noise-layer.enabled {
  opacity: 0.16;
}

.noise-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: auto;
  mix-blend-mode: soft-light;
}

.portfolio-page {
  background: #0f0f0f;
}

.dynamic-text {
  opacity: 0;
}

.page-ready .dynamic-text {
  opacity: 1;
  transition: opacity 120ms ease;
}

body.nav-animating .topbar {
  pointer-events: none;
}

#portfolioNoise {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.portfolio-root {
  min-height: 100vh;
  padding-top: 0;
  position: relative;
  z-index: 2;
}

.portfolio-content {
  padding: 0;
  position: relative;
}

.pdf-canvas-root {
  display: none;
  width: 100%;
  margin: 0 auto;
  background: transparent;
  border-radius: 0;
  overflow: hidden;
}

.pdf-canvas-root canvas {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.pdf-placeholder {
  width: min(960px, 100%);
  min-height: 65vh;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  background: #111;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.admin-page {
  background: #0f0f0f;
}

.admin-root {
  width: min(1080px, 100% - 32px);
  margin: 24px auto 48px;
  display: grid;
  gap: 16px;
}

.admin-note {
  margin: 0;
  color: var(--muted);
}

.admin-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 18px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.admin-sections {
  display: grid;
  gap: 16px;
}

.section-card {
  display: grid;
  gap: 12px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.admin-save-wrap {
  display: flex;
  justify-content: flex-end;
}

.admin-form label,
.upload-item label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

input,
button,
select {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="file"],
input[type="color"],
select,
.admin-form input {
  width: 100%;
  background: #0f0f0f;
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
}

input[type="color"] {
  padding: 4px;
  min-height: 42px;
}

input[type="checkbox"] {
  width: auto;
  justify-self: start;
  transform: scale(1.15);
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 500;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.upload-item {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.upload-actions {
  display: flex;
  gap: 8px;
}

.upload-status {
  color: var(--muted);
  word-break: break-all;
}

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 100;
}

.transition-clone {
  position: fixed;
  z-index: 80;
  margin: 0;
  transform: none;
  pointer-events: none;
  transition:
    top 1600ms cubic-bezier(0.22, 1, 0.36, 1),
    left 1600ms cubic-bezier(0.22, 1, 0.36, 1),
    width 1600ms cubic-bezier(0.22, 1, 0.36, 1),
    height 1600ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 500ms ease;
}

.transition-clone.fade-out {
  opacity: 0;
}

.page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background-image: var(--nav-transition-bg, none);
  background-size: cover;
  background-position: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.page-transition-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.2));
}

.page-transition-overlay.fade-out {
  opacity: 0;
}

html.has-nav-transition .page-transition-overlay {
  opacity: 1;
}

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

  .left-card {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .portfolio-content {
    padding: 0;
  }

  .topbar {
    top: 14px;
    left: 20px;
    right: 20px;
  }

  .topbar-right {
    gap: 8px;
  }
}
