/* ------------------------------------------------
   Half-Light Studio — classless, semantic CSS
   Fonts : Lexend (body) · Space Mono (accent)
   ------------------------------------------------ */

:root {
  --bg-dark:        #0C0B1A;
  --text-primary:   #F5F0EB;
  --text-secondary: #9B93A8;
  --text-muted:     #6B5F7A;
  --lavender:       #A870AB;
  --plum:           #7B1F6C;
  --dark-plum:      #4F2B50;
  --blush:          #ECB4AA;
  --dusty-rose:     #CD7B7A;
  --mauve:          #A44D8D;
}


/* ---- reset ---- */

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

body {
  font-family: "Lexend", sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}


/* ---- main split ---- */

main {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

main > article {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 480px;
  min-width: 480px;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  padding: 48px 48px 40px 64px;
}

main > figure {
  flex: 1;
  overflow: hidden;
}

main > figure > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: drift 45s ease-in-out infinite alternate;
  will-change: transform;
}

main > figure::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  backdrop-filter: blur(3px);
  pointer-events: none;
}

main > figure::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    ellipse at 30% 40%,
    rgba(168, 112, 171, 0.08) 0%,
    transparent 60%
  ),
  radial-gradient(
    ellipse at 70% 60%,
    rgba(236, 180, 170, 0.06) 0%,
    transparent 50%
  );
  animation: glow 30s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes drift {
  0%   { transform: scale(1.04) translate(0, 0); }
  100% { transform: scale(1.12) translate(-3%, -1.5%); }
}

@keyframes glow {
  0%   { opacity: 0.5; transform: translate(0, 0) scale(1); }
  50%  { opacity: 1; transform: translate(6%, -4%) scale(1.2); }
  100% { opacity: 0.4; transform: translate(-4%, 2%) scale(0.9); }
}


/* ---- header / logo ---- */

header a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

header h1 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

header svg {
  flex-shrink: 0;
}


/* ---- hero content section ---- */

article > section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

article > section > small {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  color: var(--lavender);
  letter-spacing: 3px;
  text-transform: uppercase;
}

article > section > h2 {
  font-size: 48px;
  font-weight: 300;
  line-height: 1.1;
  color: var(--text-primary);
}

article > section > p {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-primary);
}

article > section > p + p {
  font-size: 14px;
  color: var(--text-secondary);
}


/* ---- CTA nav ---- */

article > section > nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

article > section > nav > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  border-radius: 6px;
  background: var(--plum);
  color: var(--text-primary);
  font-family: "Space Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

article > section > nav > a:hover {
  background: var(--mauve);
}

article > section > nav > small {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
}

article > section > nav > small > a {
  color: var(--lavender);
  text-decoration: none;
}

article > section > nav > small > a:hover {
  text-decoration: underline;
}


/* ---- footer ---- */

article > footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

article > footer > hr {
  border: none;
  height: 1px;
  background: var(--dark-plum);
  opacity: 0.3;
}

article > footer > small {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  color: var(--text-muted);
}

article > footer > small > span {
  opacity: 0.4;
}

article > footer > small > a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

article > footer > small > a:hover {
  color: var(--lavender);
}

article > footer > small > em {
  font-style: italic;
  opacity: 0.5;
  margin-left: auto;
}


/* ---- dialogs ---- */

main > figure {
  position: relative;
}

main > figure > dialog {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  background: rgba(12, 11, 26, 0.4);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

main > figure > dialog[open] {
  pointer-events: auto;
}

main > figure > dialog[data-open] {
  opacity: 1;
  transform: translateY(0);
}

dialog form {
  width: min(570px, 100% - 48px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--bg-dark);
  padding: 40px;
  border-radius: 8px;
  border: 1px solid rgba(245, 240, 235, 0.06);
  box-shadow:
    0 2px 8px rgba(12, 11, 26, 0.3),
    0 8px 24px rgba(12, 11, 26, 0.25),
    0 24px 64px rgba(12, 11, 26, 0.2);
}

dialog header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

dialog h3 {
  font-family: "Lexend", sans-serif;
  font-size: 28px;
  font-weight: 300;
  color: var(--text-primary);
}

dialog header > p {
  font-family: "Lexend", sans-serif;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-secondary);
}

dialog > article {
  width: min(570px, 100% - 48px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--bg-dark);
  padding: 40px;
  border-radius: 8px;
  border: 1px solid rgba(245, 240, 235, 0.06);
  box-shadow:
    0 2px 8px rgba(12, 11, 26, 0.3),
    0 8px 24px rgba(12, 11, 26, 0.25),
    0 24px 64px rgba(12, 11, 26, 0.2);
}

dialog > article > section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

dialog > article > section > p {
  font-family: "Lexend", sans-serif;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-secondary);
}

dialog > article > footer > button[type="button"] {
  height: 44px;
  width: 100%;
  border: 1px solid var(--dark-plum);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: "Space Mono", monospace;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

dialog > article > footer > button[type="button"]:hover {
  border-color: var(--lavender);
  color: var(--text-primary);
}

dialog label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

dialog input,
dialog textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--dark-plum);
  border-radius: 6px;
  background: #151425;
  color: var(--text-primary);
  font-family: "Space Mono", monospace;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

dialog input:focus,
dialog textarea:focus {
  border-color: var(--lavender);
}

dialog input::placeholder,
dialog textarea::placeholder {
  color: var(--text-muted);
}

dialog input:invalid:not(:placeholder-shown),
dialog textarea:invalid:not(:placeholder-shown) {
  border-color: var(--dusty-rose);
}

dialog textarea {
  resize: vertical;
  min-height: 100px;
}

dialog form > footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

dialog form > footer > button[type="submit"] {
  height: 44px;
  border: none;
  border-radius: 6px;
  background: var(--plum);
  color: var(--text-primary);
  font-family: "Space Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

dialog form > footer > button[type="submit"]:hover {
  background: var(--mauve);
}

dialog form > footer > button[type="button"] {
  height: 36px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-family: "Space Mono", monospace;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease;
}

dialog form > footer > button[type="button"]:hover {
  color: var(--text-secondary);
}


/* ---- responsive ---- */

@media (max-width: 960px) {
  main {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  main {
    display: grid;
    grid-template-rows: auto auto auto;
  }

  main > article {
    display: contents;
  }

  main > article > header {
    order: 1;
    padding: 32px 32px 24px;
  }

  main > figure {
    order: 2;
    position: relative;
    height: 200px;
    margin: 0 32px;
    border-radius: 8px;
    flex: none;
  }

  main > article > section {
    order: 3;
    padding: 40px 32px 0;
  }

  main > article > footer {
    order: 4;
    padding: 48px 32px 32px;
  }

  main > figure > img {
    border-radius: 8px;
  }

  main > figure::before,
  main > figure::after {
    border-radius: 8px;
  }

  main > figure > dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    background: rgba(12, 11, 26, 0.85);
    backdrop-filter: blur(12px);
  }

  dialog form,
  dialog > article {
    width: min(570px, 100% - 48px);
    max-height: 90dvh;
    overflow-y: auto;
  }
}

@media (max-width: 600px) {
  main > article {
    padding: 32px 24px;
  }

  main > article > header {
    padding: 24px 24px 20px;
  }

  main > figure {
    height: 180px;
    margin: 0 24px;
  }

  main > article > section {
    padding: 32px 24px 0;
  }

  main > article > footer {
    padding: 40px 24px 24px;
  }

  article > section > h2 {
    font-size: 36px;
  }

  article > section > p {
    font-size: 14px;
  }

  dialog form,
  dialog > article {
    padding: 32px 24px;
  }
}
