/* Dovanatorius — one stylesheet.

   Warm paper, cranberry ink for what you can do, pine green for what has
   gone out. The letter a participant will read is set in a serif, like a
   card; everything clicked and typed is in the sans. */

@font-face {
  font-family: "Instrument Sans";
  src: url("/static/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/static/fonts/instrument-sans-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/static/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/static/fonts/source-serif-4-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/static/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #f6f1ea;
  --bg-elev: #fffcf7;
  --bg-sunk: #ede5da;
  --ink: #2a1d1a;
  --ink-soft: #6b5753;
  --line: #e2d7ca;
  --line-strong: #cdbfae;

  --accent: #a3262e;          /* cranberry: actions */
  --accent-ink: #ffffff;
  --accent-soft: #f6dedd;
  --done: #2f6b4a;            /* pine: sent */
  --done-soft: #dcebe1;
  --gold: #a7731a;            /* in progress, drafts */
  --gold-soft: #f4e7c9;
  --danger: #a13d2b;
  --danger-soft: #f4dfd9;

  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 10px;
  --radius-small: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1414;
    --bg-elev: #231b1b;
    --bg-sunk: #140f0f;
    --ink: #f0e7e2;
    --ink-soft: #b3a39d;
    --line: #3a2e2c;
    --line-strong: #4f3f3c;

    --accent: #f08a8f;
    --accent-ink: #2a0d10;
    --accent-soft: #42201f;
    --done: #8fcca6;
    --done-soft: #1d3326;
    --gold: #e6b65c;
    --gold-soft: #3a2d14;
    --danger: #ef8b78;
    --danger-soft: #3a1d18;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { font-weight: 600; letter-spacing: -.012em; }

/* ---------------------------------------------------------------------------
   Signed-out pages */
.landing {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 6rem) 1.25rem 4rem;
}

.brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 2rem; }
.brand .wordmark { font-size: clamp(1.6rem, 5vw, 2rem); font-weight: 600; letter-spacing: -.02em; }

.landing h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.75rem, 5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -.015em;
  max-width: 30rem;
  margin: 0 0 1rem;
}
.landing .card h1 { font-family: var(--sans); font-size: 1.25rem; font-weight: 600; margin: 0 0 .75rem; }

.mark {
  display: grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1;
}

.lede {
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 32rem;
  margin: 0 0 2.5rem;
}

.features {
  list-style: none;
  display: grid;
  gap: 1.25rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  padding: 0;
  margin: 3rem 0 0;
}
.features li { display: grid; gap: .2rem; }
.features strong { font-size: .95rem; font-weight: 600; }
.features span { color: var(--ink-soft); font-size: .925rem; }

/* ---------------------------------------------------------------------------
   Surfaces. A card is a flat panel, used for the thing a page is about; a
   plain card is a section that sits on the page itself. */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3.5vw, 1.75rem);
}
.card.plain {
  background: none;
  border: none;
  border-top: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 1.25rem 0 0;
}

.card h2 { margin: 0 0 .35rem; font-size: 1.05rem; }
.hint { color: var(--ink-soft); font-size: .9rem; margin: 0 0 1.25rem; }
.field .hint { margin: 0; font-size: .82rem; }
.hint code, .prose code {
  font-family: var(--mono);
  font-size: .86em;
  padding: .05rem .3rem;
  border-radius: 4px;
  background: var(--bg-sunk);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------------------
   Forms. One look for every field, so a page of settings and a chat box are
   visibly the same application. */
form { display: grid; gap: .5rem; }
label { font-size: .875rem; font-weight: 600; color: var(--ink); }

input[type="email"],
input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: .65rem .8rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  transition: border-color .15s, box-shadow .15s;
}
.card:not(.plain) input[type="email"],
.card:not(.plain) input[type="text"],
.card:not(.plain) input[type="url"],
.card:not(.plain) input[type="password"],
.card:not(.plain) input[type="number"],
.card:not(.plain) input[type="date"],
.card:not(.plain) select,
.card:not(.plain) textarea { background: var(--bg); }
textarea { min-height: 6rem; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--ink-soft) 75%, transparent); }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

input[type="file"] { max-width: 100%; font: inherit; font-size: .9rem; color: var(--ink-soft); }
input[type="file"]::file-selector-button {
  margin-right: .75rem;
  padding: .4rem .8rem;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--ink-soft); }

button {
  justify-self: start;
  margin-top: .35rem;
  padding: .6rem 1.2rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}

button:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
button:active { transform: translateY(1px); }
button[disabled] { opacity: .55; cursor: progress; }
button.danger { background: var(--danger); border-color: var(--danger); color: var(--bg-elev); }
button.danger:hover { background: color-mix(in srgb, var(--danger) 88%, var(--ink)); }

.linkish {
  background: none;
  color: var(--ink);
  padding: .35rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  font-size: .875rem;
  font-weight: 500;
  margin-top: 0;
}
.linkish:hover { background: var(--bg-sunk); border-color: var(--ink-soft); }
.linkish.danger { background: none; border-color: var(--line-strong); color: var(--danger); }
.linkish.danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.button-link {
  display: inline-block;
  padding: .6rem 1.2rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius-small);
  text-decoration: none;
  transition: background-color .15s;
}
.button-link:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.button-link:active { transform: translateY(1px); }

.field { display: grid; gap: .3rem; }
.fields { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.fields .wide { grid-column: 1 / -1; }
.buttons { display: flex; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; margin-top: .75rem; }
.buttons button { margin-top: 0; }
.inline { display: inline; }
.tick { display: flex; align-items: center; gap: .5rem; font-size: .925rem; font-weight: 500; }

.status { margin: 1rem 0; font-size: .925rem; min-height: 1.4em; }
.status:empty { margin: 0; min-height: 0; }
.status-ok, .status-error { padding: .65rem .9rem; border-radius: var(--radius-small); border-left: 3px solid; }
.status-ok { color: var(--done); background: var(--done-soft); }
.status-error { color: var(--danger); background: var(--danger-soft); }

/* ---------------------------------------------------------------------------
   The site footer, under every page. It sits outside the page's own <main>,
   so it carries the same width itself rather than inheriting one. */
.sitefoot {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  color: var(--ink-soft);
  font-size: .82rem;
  text-align: center;
}
.sitefoot p { margin: 0 0 .35rem; }
.sitefoot p:last-child { margin-bottom: 0; }
.sitefoot a { color: inherit; }
.sitefoot .sep { padding: 0 .3rem; opacity: .45; }
main.landing ~ .sitefoot { max-width: 44rem; }
main.prose ~ .sitefoot { max-width: 44rem; }

/* ---------------------------------------------------------------------------
   Signed-in shell */
.app { max-width: 56rem; margin: 0 auto; padding: 1.25rem 1.25rem 4rem; }
.app > * + * { margin-top: 1.75rem; }
.app > .appbar + * { margin-top: 0; }
.app .card + .card { margin-top: 1.75rem; }

/* Static prose pages: privacy, terms, about. */
.prose { max-width: 44rem; }
.prose-head { margin-bottom: 2rem; }
.prose-head .brand-small { text-decoration: none; color: inherit; }
main.prose h1 { font-family: var(--serif); font-weight: 500; font-size: 2rem; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 1rem; }
main.prose h2 { font-size: 1.1rem; margin: 2.25rem 0 .5rem; }
main.prose p, main.prose li { color: var(--ink-soft); }
main.prose p { margin: 0 0 1rem; }
main.prose ul { margin: 0 0 1rem; padding-left: 1.25rem; }
main.prose li { margin-bottom: .5rem; }
.prose strong { color: var(--ink); }

/* The bar: where you are on the left, who you are on the right. */
.appbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  padding-bottom: 1.1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
.appbar-identity { display: flex; align-items: center; gap: .75rem; margin-left: auto; min-width: 0; }
.appbar-identity form { margin: 0; }
.brand-small { display: flex; align-items: center; gap: .5rem; font-weight: 600; white-space: nowrap; color: inherit; text-decoration: none; letter-spacing: -.01em; }
.brand-small .mark { width: 1.6rem; height: 1.6rem; font-size: .95rem; }
.who {
  color: var(--ink-soft);
  font-size: .875rem;
  min-width: 0;
  max-width: min(22rem, 45vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.who { text-decoration: none; }
a.who:hover { color: var(--ink); }

.appnav { display: flex; flex-wrap: wrap; gap: .25rem; font-size: .925rem; }
.appnav a { text-decoration: none; color: var(--ink-soft); padding: .3rem .65rem; border-radius: 999px; }
.appnav a:hover { color: var(--ink); background: var(--bg-sunk); }
.appnav a.on { color: var(--ink); font-weight: 600; background: var(--bg-sunk); }

@media (max-width: 40rem) {
  .appbar-identity { margin-left: 0; width: 100%; justify-content: space-between; }
  .appnav { order: 3; width: 100%; margin-left: -.65rem; }
}

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
  flex-wrap: wrap;
  margin-bottom: .35rem;
}
.list-head h1, .list-head h2 { margin: 0; }
.list-head > a { font-size: .9rem; }

.crumb { font-size: .875rem; color: var(--ink-soft); margin: 0 0 1rem; }
.crumb a { color: inherit; text-decoration-color: var(--line-strong); }
.crumb a:hover { color: var(--ink); }
.empty { color: var(--ink-soft); margin: 1rem 0 0; }

.badge {
  font-size: .75rem;
  font-weight: 500;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .05rem .55rem;
  white-space: nowrap;
}
/* ---------------------------------------------------------------------------
   Lists of rows: projects, tasks, secrets, connections. */
.rows { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; }
.rows > li {
  display: flex;
  align-items: center;
  gap: .5rem 1rem;
  flex-wrap: wrap;
  padding: .8rem 0;
  border-top: 1px solid var(--line);
}
.rows > li:first-child { border-top: none; }
.rows .main { flex: 1 1 14rem; min-width: 0; display: grid; gap: .15rem; }
.rows .title { font-weight: 600; overflow-wrap: anywhere; text-decoration: none; color: var(--ink); }
a.title:hover { color: var(--accent); text-decoration: underline; }
.rows .sub { color: var(--ink-soft); font-size: .85rem; overflow-wrap: anywhere; }
.rows .meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rows form { margin: 0; }
.ref { font-family: var(--mono); font-size: .78rem; color: var(--ink-soft); }

/* Two quiet sections side by side where there is room. */
.pair { display: grid; gap: 1.75rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); align-items: start; }
.pair > .card + .card { margin-top: 0; }

/* ---------------------------------------------------------------------------
   Account, connections, danger. */
.account { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem 1.25rem; margin: 1rem 0 0; }
.account dt { color: var(--ink-soft); font-size: .9rem; }
.account dd { margin: 0; overflow-wrap: anywhere; }

.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.danger-zone h2 { color: var(--danger); }
.delete-account { display: flex; align-items: end; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.delete-account .field { flex: 0 1 18rem; }
.delete-account button { margin-top: 0; }


/* ---------------------------------------------------------------------------
   Dovanatorius */
.brand-link { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; }
img.mark { display: block; width: 2.5rem; height: 2.5rem; background: none; border-radius: 0; }
.brand-small img.mark { width: 1.6rem; height: 1.6rem; }
ol.features { counter-reset: step; }
ol.features li { counter-increment: step; position: relative; padding-left: 2.2rem; }
ol.features li::before {
  content: counter(step);
  position: absolute; left: 0; top: .05rem;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
}

.problems ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.problems li + li { margin-top: .2rem; }

form.exchange-form { gap: 1.25rem; }
fieldset.letter {
  margin: 0; padding: 1rem 1.1rem 1.1rem;
  display: grid; gap: 1rem;
  border: 1px solid var(--line); border-radius: var(--radius);
}
fieldset.letter legend { font-size: .875rem; font-weight: 600; padding: 0 .4rem; }
textarea.mono { font-family: var(--mono); font-size: .9rem; }
#body { font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; }
select { appearance: auto; }

.letter-preview {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 1rem 1.1rem;
  margin: .75rem 0;
  box-shadow: 0 1px 0 var(--line);
}
.letter-subject { font-weight: 600; margin: 0 0 .6rem; padding-bottom: .5rem; border-bottom: 1px dashed var(--line-strong); }
.letter-body { font-family: var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }

.people { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .35rem; }
.people .sub { color: var(--ink-soft); font-size: .875rem; overflow-wrap: anywhere; }

.draw-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 35%, var(--bg-elev)); }
.draw-card p { margin: 0 0 1rem; max-width: 40rem; }
.draw-card form { gap: .75rem; }
button.big { padding: .8rem 1.5rem; font-size: 1.05rem; }

.delivery .list-head { margin-bottom: .25rem; }
.delivery .list-head h2 { font-size: 1.05rem; }
.delivery form { margin-top: 1rem; }
.delivery-rows .report-row { border-top: 1px dashed var(--line-strong); }
.send-error { color: var(--danger); font-size: .8rem; overflow-wrap: anywhere; flex-basis: 100%; text-align: right; }

.badge.state-draft { color: var(--gold); border-color: transparent; background: var(--gold-soft); }
.badge.state-sending { color: var(--gold); border-color: transparent; background: var(--gold-soft); }
.badge.state-sent { color: var(--done); border-color: transparent; background: var(--done-soft); }
.badge.state-failed { color: var(--danger); border-color: transparent; background: var(--danger-soft); }

.rows > li.exchange-row { position: relative; padding-left: 1.1rem; }
.rows > li.exchange-row::before {
  content: ""; position: absolute; left: 0; top: .85rem; bottom: .85rem;
  width: 3px; border-radius: 2px; background: var(--gold);
}
.rows > li.exchange-row.drawn::before { background: var(--done); }

.push-right { margin-left: auto; }
.push-top { margin-top: 1.25rem; }
.page-head h1 { margin: 0 0 .25rem; }
.page-head .hint { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
a.linkish { display: inline-block; text-decoration: none; line-height: 1.55; }
