/* ==========================================================================
   CrabKing's Lair — stylesheet
   Palette: deep abyss navy with coral + gold accents.
   Backdrop: assets/crabkingslair.jpeg (fixed, full-bleed, behind a scrim).
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------- */
:root {
  --abyss:        #060b14;
  --abyss-soft:   #0b1524;
  --surface-hover: rgba(255, 255, 255, 0.06);
  --line:         rgba(255, 255, 255, 0.09);
  --line-strong:  rgba(255, 255, 255, 0.16);

  --coral:        #ff6b4a;
  --coral-soft:   #ff8f74;
  --gold:         #f4c15d;

  --text:         #e9eff8;
  --text-muted:   #93a3b8;

  --radius-sm:    12px;
  --container:    1120px;

  --shadow:       0 24px 60px -30px rgba(0, 0, 0, 0.9);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
}

/* --- Reset --------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { background-color: var(--abyss); }

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fixed backdrop image + legibility scrim (iOS-safe: no background-attachment) */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background: url("assets/crabkingslair.jpeg") center / cover no-repeat;
}

body::after {
  background:
    radial-gradient(900px 600px at 50% 0%,  rgba(255, 107, 74, 0.16), transparent 62%),
    linear-gradient(180deg, rgba(6, 11, 20, 0.70), rgba(6, 11, 20, 0.86));
}

/* The request page shows the artwork as a 25% image beside the text,
   so the full-bleed backdrop is switched off there. */
body.page-request::before { content: none; }

img, svg { display: block; max-width: 100%; }

p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

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

/* --- Layout helpers ------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* Pushes the footer to the bottom of the viewport while main is empty */
.page-main { flex: 1 0 auto; }

.page-head { padding-top: clamp(48px, 8vw, 88px); }

.page-head h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn-primary {
  background: linear-gradient(100deg, var(--coral), var(--gold));
  color: #1a0d08;
  box-shadow: 0 14px 34px -16px rgba(255, 107, 74, 0.9);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px -16px rgba(255, 107, 74, 0.95);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* --- Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 11, 20, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 11px;
  color: var(--coral);
  background: rgba(255, 107, 74, 0.14);
  border: 1px solid rgba(255, 107, 74, 0.28);
}

.brand-mark svg { width: 20px; height: 20px; }

.brand-text em {
  font-style: normal;
  color: var(--coral);
}

/* Brand block: logo, with the contact details beneath it on the left */
.header-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-block: 12px;
}

.header-contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 46px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.header-contact a {
  transition: color 0.18s ease;
}

.header-contact a:hover { color: var(--coral-soft); }

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-list a {
  font-size: 0.94rem;
  color: var(--text-muted);
  transition: color 0.18s ease;
}

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

.nav-list a[aria-current="page"] { color: var(--text); }

/* Mobile toggle */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px; height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: relative;
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after  { top: 4px; }

.nav-open .nav-toggle-bars { background: transparent; }
.nav-open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle-bars::after  { transform: translateY(-4px) rotate(-45deg); }

/* --- Requests grid (view only) ------------------------------------------- */
.page-note {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.requests-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-top: 28px;
}

.request-card {
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.request-card h2 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--coral-soft);
}

.request-card dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.request-card dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.request-card dd {
  margin: 4px 0 0;
  font-size: 0.96rem;
}

/* --- Artwork request page ------------------------------------------------ */
.request-layout {
  display: grid;
  grid-template-columns: 25% 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
  padding-top: clamp(40px, 7vw, 72px);
  padding-bottom: clamp(56px, 9vw, 96px);
}

.request-art { margin: 0; }

.request-art img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.request-body { min-width: 0; }

.request-title {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0;
}

.request-lede {
  margin-top: 18px;
  max-width: 58ch;
  color: var(--text-muted);
  font-size: 1.06rem;
}

.request-form {
  display: grid;
  gap: 18px;
  max-width: 520px;
  margin-top: 34px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field input,
.field select {
  width: 100%;
  padding: 13px 16px;
  font: inherit;
  font-size: 0.98rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}

.field select option { background: var(--abyss-soft); color: var(--text); }

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.22);
}

.request-form .btn { justify-self: start; }

.form-note {
  min-height: 1.4em;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.form-note[data-state="error"] { color: var(--coral-soft); }
.form-note[data-state="ok"]    { color: var(--gold); }

/* --- Focus styles -------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 16px 24px 24px;
    background: rgba(6, 11, 20, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);

    /* Collapsed by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }

  .nav-open .site-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-list a {
    display: block;
    padding: 14px 4px;
    font-size: 1rem;
    color: var(--text);
    border-bottom: 1px solid var(--line);
  }

  .request-layout { grid-template-columns: 1fr; }
  .request-art { max-width: 50%; }
}

/* --- Motion preferences -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
