:root {
  color-scheme: dark;
  --brand: #4d0106;
  --brand-deep: #260003;
  --brand-lift: #75080f;
  --ember: rgba(168, 20, 32, 0.45);
  --cream: #f4e8d9;
  --cream-soft: #e7d6c2;
  --cream-mute: rgba(244, 232, 217, 0.68);
  --line: rgba(244, 232, 217, 0.16);
  --font: "Source Sans 3", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--cream);
  background: var(--brand-deep);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 6px;
}

/* --- Atmosphere --- */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: var(--brand-deep);
}

.velvet {
  position: absolute;
  inset: -35%;
  background: conic-gradient(
    from 12deg at 52% 42%,
    #5a0208 0deg,
    #3a0106 22deg,
    #77080f 46deg,
    #420107 74deg,
    #5a0208 102deg,
    #370105 128deg,
    #830a13 152deg,
    #3f0106 182deg,
    #5a0208 210deg,
    #380105 238deg,
    #6e070e 262deg,
    #3d0106 292deg,
    #5a0208 318deg,
    #3a0106 344deg,
    #5a0208 360deg
  );
  filter: blur(72px);
  animation: velvet-drift 48s linear infinite;
}

.ember {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 55% at 50% 38%,
    var(--ember),
    transparent 72%
  );
  animation: ember-breathe 8s ease-in-out infinite alternate;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 82% 78% at 50% 45%,
    transparent 42%,
    rgba(0, 0, 0, 0.72) 100%
  );
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

@keyframes velvet-drift {
  from {
    transform: rotate(0deg) scale(1.35);
  }
  to {
    transform: rotate(2.4deg) scale(1.35);
  }
}

@keyframes ember-breathe {
  from {
    opacity: 0.75;
    transform: scale(1);
  }
  to {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stage-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --- Header --- */

.masthead {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px clamp(20px, 5vw, 72px);
  animation: rise-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cream);
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 6px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
  font-weight: 500;
  color: var(--cream-mute);
}

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

.nav-cta {
  color: var(--cream) !important;
  border-bottom: 1px solid var(--cream-soft);
  padding-bottom: 1px;
}

/* --- Hero --- */

.hero {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - 76px);
}

.hero-stage {
  position: relative;
  width: 100%;
  height: 350px;
  max-height: 350px;
  overflow: hidden;
  animation: stage-in 1.1s ease both;
}

.hero-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px) clamp(20px, 5vw, 72px) clamp(48px, 8vw, 80px);
  animation: rise-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5.4vw, 56px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  max-width: 16ch;
}

.lede {
  margin: 16px 0 0;
  max-width: 42ch;
  font-size: clamp(17px, 1.7vw, 19px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--cream-mute);
}

/* --- Shared sections --- */

.work,
.legal,
.contact {
  padding: clamp(64px, 10vw, 120px) clamp(20px, 5vw, 72px);
  max-width: 960px;
  margin: 0 auto;
}

.section-label {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-mute);
}

.work h2,
.legal h2,
.contact h2 {
  margin: 0;
  font-size: clamp(26px, 3.8vw, 40px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  max-width: 18ch;
}

.section-copy {
  margin: 16px 0 0;
  max-width: 48ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--cream-mute);
}

/* --- Portfolio --- */

.portfolio {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
}

.portfolio-empty {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--cream-mute);
}

.portfolio-mark {
  color: var(--cream-soft);
  opacity: 0.85;
  margin-bottom: 4px;
}

.portfolio-empty strong {
  font-size: 20px;
  font-weight: 600;
  color: var(--cream);
}

.portfolio-empty span:last-child {
  max-width: 40ch;
  font-size: 16px;
  line-height: 1.55;
}

/* --- Legal / product docs --- */

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

.doc-list {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.doc-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  font-weight: 500;
}

.doc-status {
  font-size: 14px;
  font-weight: 400;
  color: var(--cream-mute);
  text-align: right;
  flex-shrink: 0;
}

/* --- Contact --- */

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

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 13px 20px;
  border: 1px solid var(--cream-soft);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.25s ease, color 0.25s ease;
}

.cta span {
  font-size: 15px;
  transition: transform 0.25s ease;
}

.cta:hover {
  background: var(--cream);
  color: var(--brand-deep);
}

.cta:hover span {
  transform: translate(2px, -2px);
}

/* --- Footer --- */

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--cream-mute);
}

/* --- Mobile --- */

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .masthead {
    padding-block: 16px;
  }

  .brand span {
    font-size: 14px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .nav {
    gap: 16px;
    font-size: 14px;
  }

  .nav a[href="#work"],
  .nav a[href="#legal"] {
    display: none;
  }

  .hero {
    min-height: unset;
  }

  .hero-stage {
    height: 300px;
    max-height: 300px;
  }

  .hero-copy {
    padding-top: 20px;
    padding-bottom: 40px;
  }

  .hero h1 {
    font-size: clamp(28px, 8.5vw, 36px);
  }

  .lede {
    font-size: 16px;
  }

  .doc-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .doc-status {
    text-align: left;
  }

  footer {
    flex-direction: column;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .velvet,
  .ember,
  .masthead,
  .hero-stage,
  .hero-copy {
    animation: none;
  }

  .velvet {
    transform: scale(1.35);
  }
}
