/* Ads by Dawn app styles.
   Idea: the sun rising over a horizon line. Black and white do the work; yellow is used only
   for the sun, the main button, and "you are here" markers. */

@font-face {
  font-family: "Bricolage";
  src: url("../assets/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Hanken";
  src: url("../assets/fonts/hanken.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #000;
  --raise: #0d0d0d;
  --raise-2: #161616;
  --line: #242424;
  --line-strong: #3a3a3a;
  --text: #fff;
  --muted: #9b9b9b;
  --sun: #FBBC04;
  --sun-ink: #000;
  --danger: #ff8a8a;
  --ok: #6ee09b;

  --paper: #fff;
  --paper-ink: #0a0a0a;
  --paper-muted: #5b5b5b;
  --paper-line: #d9d9d9;
  --paper-field: #f4f4f2;
  --paper-danger: #b3261e;
  --paper-ok: #1a7f45;

  --sidebar-w: 272px;
  --display: "Bricolage", "Hanken", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Hanken", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0 0 12px; }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: #fff; }
.btn.primary { background: var(--sun); border-color: var(--sun); color: var(--sun-ink); font-weight: 700; }
.btn.primary:hover { background: #ffc933; border-color: #ffc933; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }

.linkbtn {
  appearance: none;
  background: none;
  border: 0;
  padding: 10px 0;
  min-height: 44px;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  text-align: left;
}

/* ---------- Notices ---------- */
.notice {
  border-left: 3px solid var(--line-strong);
  background: var(--raise-2);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: .95rem;
  border-radius: 4px;
}
.notice.error { border-color: var(--danger); }
.notice.ok { border-color: var(--ok); }
.notice.info { border-color: var(--sun); }

/* ---------- Sunrise graphic (shared) ---------- */
.sunrise { width: 100%; height: 100%; }
.sunrise .horizon { stroke: #fff; stroke-opacity: .35; stroke-width: 1; }
.sunrise .ray { fill: none; stroke: var(--sun); stroke-width: 1.25; }
.sunrise .disc { fill: var(--sun); }
@media (prefers-reduced-motion: no-preference) {
  .sunrise .rise { animation: rise 1.4s cubic-bezier(.2, .7, .2, 1) both; }
  .sunrise .ray { animation: glow 1.8s ease-out both; }
  .sunrise .ray:nth-of-type(1) { animation-delay: .35s; }
  .sunrise .ray:nth-of-type(2) { animation-delay: .5s; }
  .sunrise .ray:nth-of-type(3) { animation-delay: .65s; }
  .sunrise .ray:nth-of-type(4) { animation-delay: .8s; }
}
@keyframes rise { from { transform: translateY(70px); } to { transform: none; } }
@keyframes glow { from { opacity: 0; } }

/* =====================================================
   SIGN-IN PAGE
   ===================================================== */
.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  padding: 44px clamp(32px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}
.auth-logo { width: 168px; height: auto; position: relative; z-index: 1; }
.auth-hero { position: relative; z-index: 1; max-width: 560px; padding-bottom: 40vh; }
.auth-hero h2 { font-size: clamp(2.3rem, 4.4vw, 3.9rem); font-weight: 750; line-height: 1.02; letter-spacing: -0.035em; margin-bottom: 18px; }
.auth-hero p { color: var(--muted); font-size: 1.1rem; max-width: 40ch; }
.auth-sun { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; pointer-events: none; }

.auth-panel {
  background: var(--paper);
  color: var(--paper-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(32px, env(safe-area-inset-top)) clamp(24px, 5vw, 72px) max(32px, env(safe-area-inset-bottom));
}
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 2rem; margin-bottom: 8px; }
.auth-box .sub { color: var(--paper-muted); margin-bottom: 24px; }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper-field);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 32px;
}
.segmented button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--paper-muted);
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.segmented button[aria-checked="true"] { background: var(--ink); color: #fff; }

.auth-panel .notice { background: var(--paper-field); color: var(--paper-ink); }
.auth-panel .notice.error { border-color: var(--paper-danger); }
.auth-panel .notice.ok { border-color: var(--paper-ok); }

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 7px; }
.field input {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--paper-line);
  border-radius: 12px;
  color: var(--paper-ink);
  padding: 0 14px;
  min-height: 52px;
  font: inherit;
  font-size: 16px; /* stops iPhones from zooming in */
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #8a8a8a; }
.field input:hover { border-color: #9a9a9a; }
.field input:focus { border-color: var(--paper-ink); outline: none; box-shadow: 0 0 0 4px rgba(251, 188, 4, .55); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 22px; color: var(--paper-muted); font-size: .92rem; }
.check input { accent-color: var(--ink); width: 20px; height: 20px; margin-top: 2px; flex: none; }
.check a { color: var(--paper-ink); font-weight: 600; }

.auth-box .btn.primary { width: 100%; min-height: 52px; font-size: 1.02rem; }
.auth-panel .links { display: flex; flex-direction: column; margin-top: 14px; color: var(--paper-ink); }
.auth-panel .linkbtn:hover { text-decoration-thickness: 2px; }
.fine { color: var(--paper-muted); font-size: .9rem; margin-top: 28px; }
.fine a { color: var(--paper-ink); font-weight: 600; }

@media (max-width: 900px) {
  .auth { display: block; }
  .auth-brand { min-height: 0; padding: max(24px, env(safe-area-inset-top)) 24px 0; }
  .auth-logo { width: 128px; }
  .auth-hero { padding: 36px 0 0; }
  .auth-hero h2 { font-size: 2rem; margin-bottom: 10px; }
  .auth-hero p { font-size: 1rem; margin-bottom: 0; }
  .auth-sun { position: relative; height: 190px; margin: 0 -24px; }
  .auth-panel { display: block; padding: 32px 24px max(40px, env(safe-area-inset-bottom)); }
  .auth-box { margin: 0 auto; }
}

/* =====================================================
   DASHBOARD
   ===================================================== */
.loading { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 24px; text-align: center; }
.shell { min-height: 100vh; min-height: 100dvh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: calc(60px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}
.topbar-logo { height: 28px; width: auto; }
.iconbtn {
  appearance: none;
  background: none;
  border: 0;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
}
.burger, .burger::before, .burger::after { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.burger { position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -7px; }
.burger::after { top: 7px; }

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(86vw, var(--sidebar-w));
  z-index: 40;
  background: var(--ink);
  border-right: 1px solid var(--line);
  padding: max(24px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .22s ease;
  visibility: hidden;
}
.sidebar-open .sidebar { transform: none; visibility: visible; }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .7); }
.side-logo { height: 34px; width: auto; margin: 0 8px 28px; }

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--raise-2);
  border-radius: 999px;
  padding: 3px;
  margin: 0 4px 24px;
}
.role-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  min-height: 38px;
  border-radius: 999px;
  cursor: pointer;
}
.role-switch button[aria-checked="true"] { background: #fff; color: #000; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.navitem {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: color .15s, background-color .15s;
}
.navitem svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.navitem:hover { color: #fff; background: var(--raise-2); }
.navitem[aria-current="page"] { color: #fff; background: var(--raise-2); font-weight: 650; }
.navitem[aria-current="page"] svg { stroke: var(--sun); }
.navitem[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sun);
}

.sidebar-bottom { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.whoami { display: flex; align-items: center; gap: 12px; padding: 14px 12px 0; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sun); color: #000; display: grid; place-items: center; font-family: var(--display); font-weight: 700; flex: none; }
.who { min-width: 0; line-height: 1.3; }
.who b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { display: block; font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.content { padding: 28px 20px 72px; max-width: 980px; outline: none; }

@media (min-width: 900px) {
  .topbar, .scrim { display: none !important; }
  .sidebar { transform: none; visibility: visible; width: var(--sidebar-w); transition: none; }
  .content { margin-left: var(--sidebar-w); padding: 56px clamp(32px, 5vw, 72px) 96px; }
}

/* ---------- Page content ---------- */
.page-head { margin-bottom: 32px; }
.page-head h1 { font-size: clamp(2rem, 4.2vw, 3rem); letter-spacing: -0.03em; margin-bottom: 10px; }
.page-head p { color: var(--muted); font-size: 1.08rem; max-width: 52ch; margin: 0; }

.section-title { font-size: 1.15rem; margin: 40px 0 6px; }

/* The one big moment on Home: the next thing to do, with the sun behind it. */
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 32px 28px 36px;
  min-height: 250px;
  background: var(--ink);
}
.hero-copy { position: relative; z-index: 1; max-width: 460px; }
.hero h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 10px; letter-spacing: -0.025em; }
.hero p { color: var(--muted); margin-bottom: 22px; }
.hero-sun { position: absolute; right: -40px; bottom: 0; width: min(520px, 90%); height: 80%; pointer-events: none; opacity: .9; }
@media (max-width: 640px) { .hero { padding: 26px 22px 150px; } .hero-sun { right: 0; left: 0; width: 100%; height: 130px; } }

/* A real sequence, so it is a numbered path with states. */
.path { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: p; }
.path li { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 16px; padding-bottom: 28px; }
.path li:last-child { padding-bottom: 0; }
.path li::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 2px; background: var(--line); }
.path li:last-child::before { display: none; }
.path .mark {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--line-strong);
  color: var(--muted);
  font-family: var(--display); font-weight: 700; font-size: .95rem;
  background: var(--ink);
  position: relative; z-index: 1;
}
.path .done .mark { background: var(--sun); border-color: var(--sun); color: #000; }
.path .done::before { background: var(--sun); }
.path .now .mark { border-color: var(--sun); color: var(--sun); }
.path .mark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.path h3 { font-family: var(--body); font-size: 1.05rem; letter-spacing: 0; font-weight: 650; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.path p { color: var(--muted); margin: 4px 0 0; max-width: 52ch; }

.tag {
  display: inline-block;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0;
}
.tag.live { border-color: var(--sun); color: var(--sun); }

/* Pages that are not built yet: say what will be here, as a plain list. */
.soon { border-top: 1px solid var(--line); }
.soon-head { display: flex; align-items: center; gap: 12px; padding: 24px 0 8px; }
.soon-head h2 { font-size: 1.15rem; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; gap: 14px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); color: #dcdcdc; }
.rows li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: none; transform: translateY(-2px); }

/* Settings */
.panel { border: 1px solid var(--line); border-radius: 18px; padding: 24px; background: var(--raise); }
.panel h2 { font-size: 1.15rem; margin-bottom: 18px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 14px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; font-weight: 500; }
.row-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.help-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; margin-top: 36px; }
.help-card h2 { font-size: 1.1rem; margin-bottom: 4px; }
.help-card p { margin: 0; color: var(--muted); }

@media (max-width: 480px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 12px; } }
