/* Nordin family site — shared styles.
   Built mobile-first: this is used almost entirely on iPhones, by people
   who won't hunt for a small target. Every tap target is at least 44px:
   inline text buttons keep their size but carry an extended hit area. */

:root{
  /* Lake Burton at night in December: dark water, spruce, lamplight, frost.
     Token names are unchanged from the old navy/amber set on purpose -- every
     page already refers to them, so the whole site re-skins from this block. */
  --navy:#07161A;        /* night water -- page ground */
  --navy-deep:#04100F;   /* under the surface -- inputs, wells */
  --navy-soft:#0E2320;   /* an ice pane -- cards */
  --spruce:#1E5346;
  --amber:#E0B45C;       /* lamplight -- the one accent */
  --amber-dim:#C89B3F;
  --cream:#F5EFE1;
  --slate:#A8CBC4;       /* frost -- secondary text */
  --line:rgba(168,203,196,0.20);
  --edge:rgba(168,203,196,0.11);   /* light catching the rim of a pane */
  --ok:#7FC49B;
  --danger:#E4756B;
  /* A deeper cranberry, used only behind small uppercase tag text. The
     lighter --danger reads at 2.6:1 against cream, which is not enough at
     10px for the older half of this family; this one clears 5:1. */
  --tag-red:#A83E34;

  --step--1:0.8125rem;
  --step-0:1rem;
  --step-1:1.125rem;
  --step-2:1.5rem;
  --step-3:2.1rem;
}

/* Tell the browser this is a dark UI. Native controls -- the date picker,
   select dropdowns, scrollbars, number spinners -- are drawn by the OS, and
   without this they come out white against everything else. */
:root{ color-scheme: dark; }

*{box-sizing:border-box; margin:0; padding:0;}
html,body{min-height:100%;}

body{
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(224,180,92,0.10), transparent 68%),
    radial-gradient(ellipse 95% 55% at 50% 100%, rgba(30,83,70,0.55), transparent 62%),
    var(--navy);
  background-attachment:fixed;
  color:var(--cream);
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  font-size:var(--step-0);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  padding:22px 18px 64px;
}

.shell{
  max-width:540px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:26px;
}

/* ---------- type ---------- */
h1{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-weight:600;
  font-size:var(--step-3);
  line-height:1.15;
  text-wrap:balance;
}
h2{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-weight:600;
  font-size:var(--step-2);
  line-height:1.2;
  text-wrap:balance;
}
h3{ font-size:var(--step-0); font-weight:600; }

.eyebrow{
  font-family:'IBM Plex Mono',ui-monospace,monospace;
  font-size:var(--step--1);
  letter-spacing:0.16em;
  text-transform:uppercase;
  color:var(--amber);
}
.muted{ color:var(--slate); }
.small{ font-size:var(--step--1); }

/* ---------- layout blocks ---------- */
.stack{ display:flex; flex-direction:column; gap:14px; }
.stack-tight{ display:flex; flex-direction:column; gap:8px; }
.row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.spread{ display:flex; gap:12px; align-items:center; justify-content:space-between; }

/* Panes of dark ice: a hairline of light along the top edge and a faint sheen
   falling off it, so a card catches the same lamplight as the hub's glass
   instead of sitting there as a flat rectangle. Matches the trip landing page. */
.card{
  background:
    linear-gradient(180deg, rgba(245,239,225,0.055), rgba(245,239,225,0) 62%),
    rgba(14,35,33,0.72);
  border:1px solid rgba(168,203,196,0.18);
  border-top-color:rgba(168,203,196,0.30);
  border-radius:13px;
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:12px;
  /* so a corner tag can hang off the top edge */
  position:relative;
}

.rule{ height:1px; background:var(--line); border:none; }

/* ---------- controls ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  min-height:48px;
  padding:12px 20px;
  border-radius:10px;
  border:1px solid transparent;
  color:var(--navy-deep);
  font-family:inherit;
  font-size:var(--step-0);
  font-weight:600;
  cursor:pointer;
  text-decoration:none;
  text-align:center;

  /* Buttons sit on a ledge and sink when pressed, so a tap feels answered on
     a phone that has no hover to lean on. The depth is tiered: primaries get
     the full ledge, quiet buttons less, pills and tabs barely any, and status
     tags none at all -- a tag is a label, not something you can push. */
  background:linear-gradient(180deg,#EBC66F,#D9A94E);
  box-shadow:0 3px 0 #8A6420, 0 6px 12px rgba(0,0,0,0.3);
}
.btn:hover{ background:linear-gradient(180deg,#F0D083,#E0B45C); }
.btn:active{
  transform:translateY(2px);
  box-shadow:0 1px 0 #8A6420, 0 3px 6px rgba(0,0,0,0.3);
}
.btn:disabled{ opacity:0.55; cursor:not-allowed; transform:none; box-shadow:none; }

.btn-quiet{
  background:linear-gradient(180deg,rgba(245,239,225,0.07),rgba(245,239,225,0) 60%),
             rgba(14,35,33,0.85);
  color:var(--cream);
  border-color:rgba(168,203,196,0.25);
  box-shadow:0 2px 0 rgba(0,0,0,0.45), 0 4px 8px rgba(0,0,0,0.22);
}
.btn-quiet:hover{
  background:linear-gradient(180deg,rgba(245,239,225,0.13),rgba(245,239,225,0.02) 60%),
             rgba(14,35,33,0.85);
}
.btn-quiet:active{ transform:translateY(1px); box-shadow:0 1px 0 rgba(0,0,0,0.45); }

.btn-danger{
  background:linear-gradient(180deg,rgba(228,117,107,0.10),rgba(228,117,107,0) 60%),
             rgba(14,35,33,0.85);
  color:var(--danger);
  border-color:rgba(210,99,90,0.45);
  box-shadow:0 2px 0 rgba(0,0,0,0.45), 0 4px 8px rgba(0,0,0,0.22);
}
.btn-danger:hover{
  background:linear-gradient(180deg,rgba(228,117,107,0.18),rgba(228,117,107,0.04) 60%),
             rgba(14,35,33,0.85);
}
.btn-danger:active{ transform:translateY(1px); box-shadow:0 1px 0 rgba(0,0,0,0.45); }

.btn-small{ min-height:44px; padding:8px 14px; font-size:var(--step--1); }

/* The one button on a card that is asking you for something. */
.btn-nudge{
  width:100%;
  border-color:rgba(200,155,63,0.5);
  color:#EBC66F;
}
.btn-block{ width:100%; }

:where(a,button,input,select,summary):focus-visible{
  outline:2px solid var(--amber);
  outline-offset:3px;
  border-radius:6px;
}

label{ display:block; font-size:var(--step--1); color:var(--slate); margin-bottom:6px; }

input[type=text], input[type=number], input[type=date], input[type=search], input[type=email], select{
  width:100%;
  min-height:48px;
  padding:11px 13px;
  border-radius:10px;
  border:1px solid var(--line);
  background:var(--navy-deep);
  color:var(--cream);
  font-family:inherit;
  font-size:var(--step-0);
}
/* The little calendar glyph ships black; tint it to match the field. */
input[type=date]::-webkit-calendar-picker-indicator{
  filter:invert(85%) sepia(12%) saturate(400%) hue-rotate(120deg);
  opacity:0.8; cursor:pointer;
}
input[type=date]::-webkit-calendar-picker-indicator:hover{ opacity:1; }

input[type=search]{ -webkit-appearance:none; appearance:none; }
input[type=search]::-webkit-search-decoration,
input[type=search]::-webkit-search-cancel-button{ -webkit-appearance:none; }

input::placeholder{ color:rgba(168,203,196,0.55); }

/* Checkbox rows are tap targets, not decorations. */
.check{
  display:flex;
  align-items:center;
  gap:11px;
  min-height:44px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:9px;
  cursor:pointer;
}
.check input{ width:20px; height:20px; accent-color:var(--amber); flex:none; }
.check.on{
  border-color:var(--amber);
  background:linear-gradient(180deg,rgba(232,163,61,0.14),rgba(232,163,61,0.04));
  box-shadow:inset 0 1px 0 rgba(245,239,225,0.12), 0 1.5px 0 rgba(0,0,0,0.35);
}

/* ---------- nudges ----------
   A card that wants something from you says so twice: a tag pinned to its top
   edge naming what is missing, and a gold rim so the card reads as unfinished
   from across the page. Both come off the moment the thing is done. */
.corner-tag{
  position:absolute; top:-9px; right:12px;
  font:500 0.62rem/1 'IBM Plex Mono',ui-monospace,monospace;
  letter-spacing:0.08em; text-transform:uppercase;
  padding:4px 8px; border-radius:5px;
  background:var(--tag-red); color:var(--cream);
  white-space:nowrap;
}
/* Gold for "there is something here for you", cranberry for "this is blank". */
.corner-tag.gold{ background:var(--amber); color:var(--navy-deep); }

.card.needs-you{
  border-top:2px solid var(--amber-dim);
  background:
    linear-gradient(180deg, rgba(224,180,92,0.08), rgba(224,180,92,0) 62%),
    rgba(14,35,33,0.72);
}

/* The one pane on a screen that carries the result or the next move. */
.lead-pane{
  position:relative;
  border:1px solid rgba(200,155,63,0.42);
  border-top-color:rgba(235,198,111,0.55);
  border-radius:13px;
  background:
    linear-gradient(180deg, rgba(224,180,92,0.10), rgba(224,180,92,0) 65%),
    rgba(14,35,33,0.72);
}

/* The corner tag's twin for overlay panels, which clip their own overflow. */
.tag-pill{
  align-self:center;
  font:500 0.62rem/1 'IBM Plex Mono',ui-monospace,monospace;
  letter-spacing:0.08em; text-transform:uppercase;
  padding:5px 10px; border-radius:5px;
  background:var(--amber); color:var(--navy-deep);
}

/* ---------- tags ---------- */
.tag{
  display:inline-block;
  padding:3px 9px;
  border-radius:999px;
  background:rgba(139,150,166,0.16);
  color:var(--cream);
  font-family:'IBM Plex Mono',ui-monospace,monospace;
  font-size:0.72rem;
  letter-spacing:0.05em;
}
.tag-pending{ background:rgba(232,163,61,0.18); color:var(--amber); }
.tag-you{ background:rgba(91,169,127,0.18); color:var(--ok); }

/* ---------- person rows ---------- */
.person{
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}
.person:last-child{ border-bottom:none; }
.person .who{ flex:1; min-width:0; }
.person .name{ font-weight:600; }
.person .sub{ font-size:var(--step--1); color:var(--slate); overflow-wrap:anywhere; }

.avatar{
  width:38px; height:38px; flex:none;
  border-radius:50%;
  background:var(--navy-deep);
  border:1px solid var(--line);
  display:grid; place-items:center;
  font-size:var(--step--1); font-weight:600; color:var(--slate);
  overflow:hidden;
}
.avatar img{ width:100%; height:100%; object-fit:cover; }

/* ---------- feedback ---------- */
.notice{
  padding:13px 15px;
  border-radius:10px;
  border-left:3px solid var(--amber);
  background:rgba(232,163,61,0.09);
  font-size:var(--step--1);
}
.notice.bad{ border-left-color:var(--danger); background:rgba(210,99,90,0.10); }
.notice.good{ border-left-color:var(--ok); background:rgba(91,169,127,0.10); }

.toast-bad{ border-color:var(--danger); border-left:3px solid var(--danger); }
.toast{
  position:fixed;
  left:50%; bottom:22px;
  transform:translateX(-50%);
  max-width:min(92vw,460px);
  padding:13px 18px;
  border-radius:10px;
  background:var(--navy-soft);
  border:1px solid var(--line);
  box-shadow:0 8px 30px rgba(0,0,0,0.42);
  font-size:var(--step--1);
  z-index:50;
}

/* ---------- confirm dialog ---------- */
/* margin:auto is what centres a modal dialog. The browser's own stylesheet
   sets it, but the *{margin:0} reset above wins over that, so say it here. */
dialog.confirm{
  margin:auto;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--navy-soft);
  color:var(--cream);
  padding:22px;
  max-width:min(92vw,420px);
  width:100%;
}
dialog.confirm::backdrop{ background:rgba(8,12,18,0.72); }
dialog.confirm .actions{ display:flex; gap:10px; margin-top:18px; }
dialog.confirm .actions .btn{ flex:1; }

/* ---------- trip links ---------- */
.trip{
  display:block;
  padding:16px 18px;
  border:1px solid var(--line);
  border-radius:12px;
  text-decoration:none;
  color:inherit;
  background:var(--navy-soft);
}
.trip:hover{ border-color:var(--amber); }
.trip .name{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-weight:600;
  font-size:var(--step-1);
  margin-bottom:3px;
}
.trip .meta{ font-size:var(--step--1); color:var(--slate); }

/* ---------- site header ---------- */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-bottom:14px;
  border-bottom:1px solid var(--line);
}
.topbar .brand{
  font-family:'Cormorant Garamond',Georgia,serif;
  font-weight:600;
  font-size:1.1rem;
  color:var(--cream);
  text-decoration:none;
}
.topbar nav{ display:flex; gap:8px; align-items:center; }

.hidden{ display:none !important; }

@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important; }
}

/* ---------- who's online ---------- */
.who-online{ position:relative; }
.who-online .who-pill{
  display:inline-flex; align-items:center; gap:7px;
  min-height:44px; padding:6px 14px;
  border:1px solid var(--line); border-radius:999px;
  background:transparent; color:var(--slate);
  font:500 var(--step--1)/1 'Inter',sans-serif; cursor:pointer;
}
.who-online .who-pill:hover{ border-color:var(--amber); color:var(--cream); }
.who-online .who-dot{
  width:8px; height:8px; border-radius:50%;
  background:var(--slate); flex:none;
}
.who-online .who-dot.live{ background:var(--ok); box-shadow:0 0 0 3px rgba(91,169,127,0.20); }
.who-online .who-list{
  position:absolute; right:0; top:calc(100% + 7px); z-index:40;
  min-width:150px; padding:11px 14px;
  background:var(--navy-soft); border:1px solid var(--line); border-radius:10px;
  box-shadow:0 8px 26px rgba(0,0,0,0.4);
  font-size:var(--step--1); line-height:1.7; color:var(--cream);
}

/* ---------- the sleigh sweep between pages ---------- */
.sleigh-layer{
  position:fixed; inset:0; z-index:9000; pointer-events:none;
  overflow:hidden;
}
.sleigh-curtain{
  position:absolute; inset:0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 40%, rgba(224,180,92,0.12), transparent 70%),
    linear-gradient(180deg, #0B1E1B 0%, #07161A 100%);
  transform:translateX(-101%);
}
.sleigh-rig{
  position:absolute; top:38%; left:0;
  width:min(86vw, 460px);
  transform:translateX(-120%);
  filter:drop-shadow(0 4px 14px rgba(0,0,0,0.5));
}
.sleigh-rig svg{ width:100%; height:auto; display:block; }

/* leaving: curtain slides in, sleigh runs ahead of it. The durations come
   from OUT_MS and IN_MS in assets/sleigh.js, which sets them on the layer;
   the fallbacks here are the same numbers. */
.sleigh-layer.out .sleigh-curtain{
  animation:curtain-close var(--sleigh-out, 450ms) cubic-bezier(.5,.05,.35,1) forwards;
}
.sleigh-layer.out .sleigh-rig{
  animation:sleigh-run var(--sleigh-out, 450ms) cubic-bezier(.45,.1,.5,1) forwards;
}
@keyframes curtain-close{
  from{ transform:translateX(-101%); } to{ transform:translateX(0); }
}
@keyframes sleigh-run{
  from{ transform:translateX(-120%) translateY(0); }
  55%{ transform:translateX(30%) translateY(-8px); }
  to{ transform:translateX(150%) translateY(0); }
}

/* arriving: curtain carries on out the other side */
.sleigh-layer.in .sleigh-curtain{
  transform:translateX(0);
  animation:curtain-open var(--sleigh-in, 300ms) cubic-bezier(.4,0,.25,1) forwards;
}
.sleigh-layer.in .sleigh-rig{ display:none; }
@keyframes curtain-open{
  from{ transform:translateX(0); } to{ transform:translateX(101%); }
}

/* The team gallops while the sweep runs: two poses, hard-cut between. pose-b
   sits hidden by default, so with animation off only the reach pose shows. */
.sleigh-rig .pose-b{ opacity:0; }
.sleigh-layer.out .pose-a{ animation:gallop-a 300ms infinite; }
.sleigh-layer.out .pose-b{ animation:gallop-b 300ms infinite; }
@keyframes gallop-a{ 0%,49%{ opacity:1; } 50%,100%{ opacity:0; } }
@keyframes gallop-b{ 0%,49%{ opacity:0; } 50%,100%{ opacity:1; } }

@media (prefers-reduced-motion: reduce){
  .sleigh-layer{ display:none !important; }
}


/* ---------- inline text buttons ----------
   These read as links inside a sentence, so they cannot be padded out to
   44px without wrecking the line. The hit area is extended instead: the
   target is finger-sized, the text is not. */
.link-btn{
  background:none; border:none; padding:0; cursor:pointer;
  color:var(--slate); font:inherit; font-size:var(--step--1);
  text-decoration:underline; text-underline-offset:2px;
  position:relative;
}
.link-btn:hover{ color:var(--cream); }
.link-btn::after{
  content:""; position:absolute; inset:-13px -8px;
}

/* ---------- snow, everywhere ---------- */
.sky{ position:fixed; inset:0; pointer-events:none; z-index:0; }
.shell{ position:relative; z-index:1; }
.sky i{
  position:absolute; top:-14px; border-radius:50%;
  background:var(--cream); animation:snowfall linear infinite;
}
@keyframes snowfall{
  0%{ transform:translateY(-14px) translateX(0); opacity:0; }
  10%{ opacity:var(--o,0.5); }
  88%{ opacity:var(--o,0.5); }
  100%{ transform:translateY(108vh) translateX(var(--drift,26px)); opacity:0; }
}
@media (prefers-reduced-motion: reduce){
  .sky{ display:none !important; }
}
