:root {
  --bg: #e8eef5;
  --ink: #0b1220;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.1);
  --panel: rgba(248, 250, 252, 0.96);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Syne", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e8eef5;
}

html::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

html::-webkit-scrollbar-track {
  background: #e8eef5;
}

html::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
  border: 3px solid #e8eef5;
}

html::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

html::-webkit-scrollbar-corner {
  background: #e8eef5;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(255, 255, 255, 0.75), transparent 55%),
    linear-gradient(180deg, #dce5f0 0%, var(--bg) 40%, #d7e0ec 100%);
  overflow-x: hidden;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 14px 0;
  background: rgba(232, 238, 245, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav__bar {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.nav__links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.nav__link {
  display: inline-flex;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.nav__link--active {
  font-weight: 700;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__website-btn {
  display: none;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(11, 18, 32, 0.18);
  background: transparent;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav__auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(11, 18, 32, 0.18);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.nav__auth-btn[hidden],
.nav__user[hidden] {
  display: none !important;
}

.nav__user {
  position: relative;
}

.nav__account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  padding: 10px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  z-index: 1100;
}

.nav__account-menu[hidden] {
  display: none;
}

.nav__account-label {
  margin: 0 0 6px;
  padding: 6px 12px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font: 600 0.78rem var(--font);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav__account-item {
  display: flex;
  width: 100%;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: 600 0.86rem var(--font);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav__account-item:hover {
  background: rgba(15, 23, 42, 0.05);
}

.nav__account-item--logout {
  color: #be123c;
}

.nav__ghost {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 0.78rem var(--font);
  text-decoration: none;
  cursor: pointer;
}

.upload-page {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.upload-hero {
  max-width: 620px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.upload-hero h1 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.98rem;
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.7fr);
  gap: 22px;
  align-items: start;
}

.upload-form,
.aside-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.upload-form {
  padding: 28px;
  display: grid;
  gap: 16px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.field label em {
  color: #be123c;
  font-style: normal;
}

.field label .optional {
  color: var(--muted);
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.06);
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.file-drop {
  display: grid;
  gap: 4px;
  padding: 18px 16px;
  border: 1px dashed rgba(15, 23, 42, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.file-drop input {
  width: 100%;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.file-drop strong {
  font-size: 0.9rem;
}

.file-drop span {
  color: var(--muted);
  font-size: 0.78rem;
}

.preview-box {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #0b1220;
}

.preview-box[hidden] {
  display: none !important;
}

.preview-box__label {
  margin: 0;
  padding: 10px 14px;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.preview-box img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #1e293b;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.submit {
  height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #eef2f7;
  font: 700 0.88rem var(--font);
  cursor: pointer;
}

.submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.message {
  margin: 0;
  min-height: 1.2em;
  color: #be123c;
  font-size: 0.86rem;
}

.message.is-success {
  color: #047857;
}

.upload-aside {
  display: grid;
  gap: 14px;
}

.aside-card {
  padding: 22px;
}

.aside-card h2,
.aside-card h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  letter-spacing: -0.03em;
}

.aside-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.9rem;
}

.aside-card--dark {
  background: linear-gradient(160deg, #0f172a, #0b1220 60%, #070b14);
  color: #e2e8f0;
  border-color: transparent;
}

.aside-card__eyebrow {
  margin: 0 0 8px;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.aside-card--dark h3 {
  color: #f8fafc;
}

.aside-card--dark p {
  margin: 0 0 14px;
  color: #94a3b8;
  line-height: 1.55;
  font-size: 0.9rem;
}

.aside-card--dark a {
  color: #f8fafc;
  font-weight: 700;
  text-decoration: none;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.auth-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, 0.55);
  backdrop-filter: blur(6px);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 28px 24px 24px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(11, 18, 32, 0.28);
}

.auth-card__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  font-size: 1.3rem;
  cursor: pointer;
}

.auth-card__eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-card h2 {
  margin: 8px 0;
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.auth-card__intro {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: 700 0.88rem var(--font);
  cursor: pointer;
}

.auth-google svg {
  width: 18px;
  height: 18px;
}

.auth-google:hover {
  background: #f8fafc;
}

.auth-google:disabled,
.auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-field {
  margin-bottom: 14px;
}

.auth-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.84rem;
  font-weight: 600;
}

.auth-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 16px;
}

.auth-field input:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.06);
}

.password-row {
  display: flex;
  gap: 8px;
}

.password-row input {
  flex: 1;
}

.password-row button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0 14px;
  font: 700 0.72rem var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.auth-submit {
  width: 100%;
  height: 48px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #eef2f7;
  font: 700 0.92rem var(--font);
  cursor: pointer;
}

.auth-message {
  min-height: 1.2em;
  margin: 12px 0 0;
  font-size: 0.86rem;
  color: #be123c;
}

.auth-message.is-success {
  color: #047857;
}

@media (max-width: 860px) {
  .nav {
    padding: 12px 0;
  }

  .nav__bar {
    width: calc(100% - 20px);
    gap: 10px;
  }

  .nav__links {
    display: none;
  }

  .nav__website-btn {
    display: none; /* bottom nav already covers Home / Website */
  }

  .nav__right {
    gap: 6px;
    min-width: 0;
  }

  .nav__auth-btn {
    width: 38px;
    height: 38px;
  }

  .upload-page {
    width: calc(100% - 20px);
    padding: 22px 0 calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .upload-hero {
    max-width: none;
    margin-bottom: 18px;
  }

  .upload-hero h1 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .lede {
    font-size: 0.9rem;
  }

  .upload-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .upload-form {
    padding: 18px 14px;
    gap: 14px;
    border-radius: 18px;
  }

  .field label {
    font-size: 0.8rem;
  }

  .field input,
  .field select {
    height: 48px;
    padding: 0 12px;
    font-size: 16px; /* avoids iOS zoom on focus */
    border-radius: 12px;
  }

  .hint {
    font-size: 0.74rem;
    line-height: 1.4;
  }

  .file-drop {
    padding: 16px 12px;
    border-radius: 12px;
  }

  .file-drop input {
    font-size: 0.82rem;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .submit {
    width: 100%;
    height: 50px;
    font-size: 0.92rem;
  }

  .message {
    font-size: 0.84rem;
    text-align: center;
  }

  .aside-card {
    padding: 16px 14px;
    border-radius: 18px;
  }

  .aside-card h2 {
    font-size: 1.1rem;
  }

  .aside-card h3 {
    font-size: 1.05rem;
  }

  .aside-card ul {
    padding-left: 16px;
    font-size: 0.84rem;
    line-height: 1.6;
  }

  .aside-card--dark p {
    font-size: 0.84rem;
  }
}

@media (max-width: 480px) {
  .nav__logo {
    font-size: 1.05rem;
  }

  .nav__auth-btn {
    width: 36px;
    height: 36px;
  }

  .upload-page {
    width: calc(100% - 16px);
    padding: 16px 0 24px;
  }

  .eyebrow {
    font-size: 0.66rem;
  }

  .upload-hero h1 {
    font-size: 1.45rem;
    margin-bottom: 8px;
  }

  .lede {
    font-size: 0.86rem;
  }

  .upload-form {
    padding: 16px 12px;
    border-radius: 16px;
  }

  .preview-box {
    border-radius: 12px;
  }

  .preview-box__label {
    padding: 8px 12px;
    font-size: 0.66rem;
  }
}

.legal-strip {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto 84px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  font-size: 0.82rem;
}

.legal-strip a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.legal-strip a:hover {
  color: var(--ink);
}

@media (min-width: 861px) {
  .legal-strip {
    margin-bottom: 20px;
  }
}
