/* Nebula: midnight sky over rose sandstone, poster lettering.
   Shape rule: buttons are pills, cards are 18px, inputs are 10px.
   Dark only on purpose: the brand mark is white on black. */
:root {
  color-scheme: dark;
  --night: #080a17;
  --night-2: #0f1328;
  --night-3: #1a2042;
  --rose: #eaa590;
  --ink: #f2efea;
  --muted: #a3a7bd;
  --line: rgba(242, 239, 234, 0.14);

  /* Poster lettering: Fredoka for "ASH", Darumadrop for the brushy caps. */
  --title: "Fredoka", "Playpen Sans Arabic", "Outfit", sans-serif;
  --brush: "Darumadrop One", "Fredoka", sans-serif;
  --sans: "Outfit", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
  --radius: 18px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Nav ---------- */
.nav-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 48px; pointer-events: none; }
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px var(--gutter);
  transition: background-color 0.3s var(--ease);
}
.nav.is-solid { background: rgba(8, 10, 23, 0.94); }
.brand { display: block; flex: none; }
.brand img { width: 150px; }
.nav-links { display: flex; align-items: center; gap: clamp(4px, 2vw, 26px); margin: 0; padding: 0; list-style: none; }
.nav-links a {
  display: block;
  padding: 8px 4px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--rose); border-color: var(--rose); }
.nav-links .nav-cta { padding: 7px 18px; border: 1px solid var(--rose); border-radius: 999px; color: var(--rose); }
.nav-links .nav-cta:hover { background: var(--rose); color: var(--night); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 30px;
  border: 1px solid var(--rose);
  border-radius: 999px;
  background: var(--rose);
  color: var(--night);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.15s var(--ease);
}
.btn:hover { background: var(--ink); border-color: var(--ink); }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: rgba(8, 10, 23, 0.55); border-color: var(--ink); color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--night); }
.btn:disabled { opacity: 0.55; cursor: default; }
.text-link { color: var(--rose); font-weight: 500; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 46%;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 10, 23, 0.8) 0%, rgba(8, 10, 23, 0.3) 55%, rgba(8, 10, 23, 0) 100%),
    linear-gradient(180deg, rgba(8, 10, 23, 0.5) 0%, rgba(8, 10, 23, 0) 26%, rgba(8, 10, 23, 0.25) 60%, var(--night) 100%);
}
.hero-inner { padding-top: 96px; padding-bottom: clamp(40px, 8vh, 88px); }
.hero-kicker { margin: 0 0 4px; font-size: 14px; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; }
.hero-title {
  margin: 0;
  font-family: var(--title);
  font-weight: 500;
  font-size: clamp(60px, 12vw, 150px);
  line-height: 1.05;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.hero-title .ar { font-family: "Playpen Sans Arabic", var(--title); font-weight: 600; letter-spacing: 0; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 1.6em;
  margin: 14px 0 28px;
  font-family: var(--brush);
  font-size: clamp(19px, 2.6vw, 28px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 10vw, 120px) 0; }
h2 { margin: 0 0 clamp(24px, 4vw, 40px); font-weight: 500; font-size: clamp(34px, 5.5vw, 56px); line-height: 1.05; letter-spacing: -0.02em; }
.lede { max-width: 54ch; margin: -12px 0 0; font-size: clamp(17px, 2vw, 20px); color: var(--muted); }
.fine { margin: 16px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- Featured event ---------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--night-2);
}
.feature-photo { position: relative; min-height: 340px; }
.feature-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.feature-body { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: clamp(24px, 4vw, 48px); }
.feature h3 { margin: 0; font-family: var(--title); font-weight: 500; font-size: clamp(40px, 5vw, 60px); line-height: 1; letter-spacing: 0.1em; text-transform: uppercase; }
.feature h3 small { display: block; margin-top: 10px; font-family: var(--brush); font-size: 0.4em; letter-spacing: 0.12em; color: var(--rose); }
.feature p { margin: 0; max-width: 50ch; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 28px; width: 100%; margin: 4px 0 8px; }
.facts dt { font-size: 14px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 19px; font-weight: 500; }
.tag { padding: 2px 10px; border-radius: 999px; background: var(--rose); color: var(--night); font-size: 13px; font-weight: 600; font-style: normal; }

/* ---------- Past nights, grouped by year ---------- */
.list-title { margin: clamp(48px, 7vw, 80px) 0 20px; font-size: 22px; font-weight: 500; }
.year-group { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.year { margin: 0; font-family: var(--brush); font-weight: 400; font-size: 26px; line-height: 1.2; letter-spacing: 0.08em; color: var(--rose); }
.year-events { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 32px; margin: 0; padding: 0; list-style: none; }
.year-events li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.year-events strong { flex: 1 1 100%; font-size: 21px; font-weight: 500; line-height: 1.25; }
.year-events span { font-size: 15px; color: var(--muted); }

/* ---------- Flights ---------- */
.flights { background: var(--night-2); }
.flight-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; margin-top: 32px; }
.flight-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--night);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.flight-link:hover { border-color: var(--rose); transform: translateY(-2px); }
.flight-link:active { transform: scale(0.99); }
.flight-link strong { display: block; font-size: 20px; font-weight: 500; }
.flight-link small { display: block; font-size: 14px; color: var(--muted); }
.flight-link .arrow { font-size: 22px; color: var(--rose); }

/* ---------- Stay teaser ---------- */
.stay-teaser { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 72px); align-items: end; }
.stay-cta { margin: 28px 0 0; }
.stay-teaser ul { display: grid; gap: 22px; margin: 0; padding: 0; list-style: none; }
.stay-teaser li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.stay-teaser li strong { font-size: 20px; font-weight: 500; }
.stay-teaser li span { flex: none; font-size: 15px; color: var(--rose); }

/* ---------- Accommodations page ---------- */
.page-hero { position: relative; padding: clamp(120px, 18vw, 200px) 0 clamp(40px, 7vw, 80px); overflow: hidden; isolation: isolate; }
.page-hero .hero-photo { object-position: 50% 40%; }
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(8, 10, 23, 0.9), rgba(8, 10, 23, 0.55)), linear-gradient(180deg, rgba(8, 10, 23, 0.3) 40%, var(--night));
}
.page-hero .hero-meta { margin: 0 0 10px; font-size: clamp(16px, 2vw, 20px); color: var(--rose); }
.page-hero h1 { margin: 0 0 28px; font-weight: 500; font-size: clamp(40px, 7vw, 76px); line-height: 1.02; letter-spacing: -0.02em; }
.page-hero .lede { color: var(--ink); }

.hotels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 20px; align-items: start; }
.hotel { display: flex; flex-direction: column; gap: 18px; padding: clamp(20px, 3vw, 30px); border-radius: var(--radius); background: var(--night-2); }
.hotel h3 { margin: 0; font-weight: 500; font-size: 26px; line-height: 1.15; letter-spacing: -0.01em; }
.hotel-type { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.hotel .desc { margin: 0; color: var(--muted); }
.hotel .btn { align-self: flex-start; }

.rates { width: 100%; border-collapse: collapse; font-size: 16px; }
.rates th, .rates td { padding: 10px 6px; text-align: right; vertical-align: baseline; }
.rates th:first-child { text-align: left; padding-left: 0; }
.rates td:last-child, .rates th:last-child { padding-right: 0; }
.rates thead th { border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--rose); }
.rates thead small { display: block; font-size: 12px; font-weight: 300; color: var(--muted); }
.rates tbody th { font-weight: 300; }
.rates td { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

.note { max-width: 70ch; margin: 28px 0 0; color: var(--muted); font-size: 16px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 34px; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; }
.tagline { margin: 12px 0 0; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0; padding: 0; list-style: none; }
.footer-links a { font-size: 15px; font-weight: 500; text-decoration: none; }
.footer-links a:hover { color: var(--rose); }
.footer small { display: block; margin-top: 24px; font-size: 13px; color: var(--muted); }
.footer small a { margin-left: 12px; }

/* ---------- Motion: hero entrance and scroll reveals (hierarchy only, off for reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * { animation: rise 0.9s var(--ease) both; }
  .hero-inner > :nth-child(2) { animation-delay: 0.08s; }
  .hero-inner > :nth-child(3) { animation-delay: 0.16s; }
  .hero-inner > :nth-child(4) { animation-delay: 0.24s; }
  @supports (animation-timeline: view()) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
  }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* ---------- Admin ---------- */
.admin-body { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.admin-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 8px clamp(12px, 2vw, 24px);
  border-bottom: 1px solid var(--line);
  background: var(--night-2);
}
.admin-bar .brand img { width: 112px; }
.admin-bar .status { margin-left: auto; font-size: 14px; color: var(--muted); text-align: right; }
.admin-bar .status.ok { color: #9be0b4; }
.admin-bar .status.err { color: #ff9c9c; }
.admin-bar .btn { min-height: 42px; padding: 8px 22px; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); }
.editor { overflow-y: auto; padding: 18px clamp(12px, 2vw, 22px) 60px; border-right: 1px solid var(--line); }
.editor > p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #000; }
.preview-tabs, .view-toggle { display: flex; gap: 4px; padding: 8px; }
.preview-tabs { flex: none; align-items: center; background: var(--night-2); border-bottom: 1px solid var(--line); }
.preview-tabs span { margin-left: auto; padding-right: 8px; font-size: 13px; color: var(--muted); }
.seg {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.seg:hover { color: var(--ink); }
.seg[aria-pressed="true"] { border-color: var(--line); background: var(--night); color: var(--ink); }
.preview iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: var(--night); }
.view-toggle { display: none; padding: 0; }

.group { margin-bottom: 10px; border-radius: var(--radius); background: var(--night-2); }
.group > summary, .item > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.group > summary::-webkit-details-marker, .item > summary::-webkit-details-marker { display: none; }
.group > summary { padding: 16px 18px; font-size: 18px; font-weight: 500; }
.group > summary::after, .item > summary::after { content: "+"; font-size: 20px; font-weight: 300; color: var(--muted); }
.group[open] > summary::after, .item[open] > summary::after { content: "\2212"; }
.group-body { padding: 0 18px 18px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-size: 14px; color: var(--muted); }
.field input, .field textarea, .field select, .login input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(242, 239, 234, 0.22);
  border-radius: 10px;
  background: var(--night);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .login input:focus { outline: none; border-color: var(--rose); }
.item { margin-top: 8px; border-radius: 12px; background: var(--night); }
.item > summary { padding: 12px 14px; font-weight: 400; overflow-wrap: anywhere; }
.item-body { padding: 4px 14px 14px; }
.item-actions { display: flex; gap: 8px; margin-top: 14px; }
.sublist-title { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.mini {
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid rgba(242, 239, 234, 0.22);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.mini:hover { border-color: var(--rose); color: var(--rose); }
.mini:disabled { opacity: 0.4; pointer-events: none; }
.mini.danger:hover { border-color: #ff9c9c; color: #ff9c9c; }
.mini.add { margin-top: 10px; border-style: dashed; }
.login { max-width: 420px; margin: 0 auto; padding: 18vh var(--gutter) 0; }
.login h1 { font-weight: 500; font-size: 34px; letter-spacing: -0.02em; margin: 0 0 6px; }
.login p { margin: 0 0 18px; color: var(--muted); }
.login form { display: grid; gap: 8px; }
.login label { font-size: 14px; color: var(--muted); }
.login .btn { margin-top: 8px; }
.login .err { color: #ff9c9c; min-height: 1.6em; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .feature, .stay-teaser { grid-template-columns: 1fr; }
  .stay-teaser { align-items: start; }
  .feature-photo { min-height: 260px; }
  .year-group { grid-template-columns: 1fr; }
  .hero::after { background: linear-gradient(180deg, rgba(8, 10, 23, 0.55) 0%, rgba(8, 10, 23, 0.05) 24%, rgba(8, 10, 23, 0.6) 58%, var(--night) 100%); }
  .workspace { grid-template-columns: 1fr; }
  .view-toggle { display: flex; }
  .workspace[data-view="edit"] .preview, .workspace[data-view="preview"] .editor { display: none; }
  .editor { border-right: 0; }
  .admin-bar .status { display: none; }
  .admin-bar .view-toggle { margin-left: auto; }
}
@media (max-width: 560px) {
  .brand img { width: 112px; }
  .nav-links a { font-size: 14px; }
  .nav-links .nav-cta { padding: 6px 12px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .fields { grid-template-columns: 1fr; }
  .rates { font-size: 15px; }
  .admin-bar .brand { display: none; }
}
@media (max-width: 420px) {
  .nav-links .nav-cta { display: none; }
  .rates th, .rates td { padding-inline: 4px; }
}
@media (max-width: 340px) {
  .brand img { width: 92px; }
  .nav-links a { font-size: 13px; }
}
