/*
 * Atty. Tony Roman / Walang LAWkohan
 * One stylesheet for every page. No inline styles anywhere, so the CSP can
 * stay at style-src 'self'.
 *
 * World: a capiz-shell window in a bahay na bato. Limewash wall, translucent
 * shell panes in narra-wood muntins, the logo's blue for action and its
 * orange for light. A lit pane means current, selected or done.
 */

@font-face {
  font-family: "TR Bonum Web";
  src: url("../fonts/tr-bonum-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TR Bonum Web";
  src: url("../fonts/tr-bonum-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TR Bonum Web";
  src: url("../fonts/tr-bonum-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  /* Daylight. The page is white; wood is only a thin accent. */
  --bg: #fdfcfa;          /* very slightly warm off-white */
  --paper: #ffffff;       /* cards, form panel, step panes */
  --band: #f7f6f2;        /* the quietest neutral field (app section, footer) */
  --field: #ffffff;
  --pane: #f1efe9;        /* pale capiz shell */
  --pane-hover: #f7f5f1;
  --pane-lit: #fff4e2;    /* shell with light behind it */
  --glow: #ffcf99;
  --ink: #201a15;
  --ink-2: #57504a;
  --num: #8a5a3e;
  --wood: #7a5a45;        /* narra, for thin frames and rules only */
  --wood-hi: #9a7a60;
  --lattice: #cdbdaa;     /* the thin muntins between panes */
  --line: #8a7f74;        /* input borders */
  --hair: rgb(32 26 21 / 0.14);
  --blue: #2b17c9;        /* from the logo's #2700f1, deepened for text */
  --btn: #2b17c9;
  --btn-hover: #1f0f9e;
  --on-btn: #ffffff;
  --sun: #fe6700;         /* the logo's orange; light only, never text */
  --err: #a3220f;
  --err-bg: #fdf0ec;
  --ok: #1f6b3a;

  --interior-1: #ffffff;
  --interior-2: #f3efe8;
  --interior-3: #e4ddd2;
  --capiz: url("../img/capiz-day.webp");
  --law-band: #ffcf99;
  --marker: #9a7a60;

  --shadow-card: 0 1px 2px rgb(32 26 21 / 0.05), 0 10px 24px -18px rgb(32 26 21 / 0.35);
  --shadow-window: 0 1px 3px rgb(32 26 21 / 0.06), 0 26px 44px -28px rgb(32 26 21 / 0.35);

  --font: "TR Bonum Web", "Bookman Old Style", "URW Bookman", Bookman, Georgia, serif;
  --wrap: 72rem;
  --gutter: 1rem;
  --muntin: 2px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --step--1: 0.9375rem;
  --step-0: clamp(1.0625rem, 1.01rem + 0.22vw, 1.1875rem);
  --step-1: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
  --step-2: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.4rem + 1.6vw, 2.625rem);
  --step-4: clamp(2.375rem, 1.6rem + 3.8vw, 4.625rem);
}

/* Dark is opt-in: the toggle sets data-theme="dark" and stores it.
   prefers-color-scheme is deliberately not used, because every visitor
   starts on the light theme. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121316;          /* dark neutral grey, never brown */
  --paper: #1a1c20;
  --band: #16181b;
  --field: #101114;
  --pane: #23262b;
  --pane-hover: #2b2f35;
  --pane-lit: #3b342b;
  --glow: #ff9d4d;
  --ink: #edecea;
  --ink-2: #b3afa9;
  --num: #ffb070;
  --wood: #6f5741;
  --wood-hi: #8a6e55;
  --lattice: #454a51;
  --line: #8b8680;
  --hair: rgb(237 236 234 / 0.14);
  --blue: #aea6ff;
  --btn: #4a36e8;
  --btn-hover: #5b49ff;
  --on-btn: #ffffff;
  --sun: #ff8c3a;
  --err: #ff9b85;
  --err-bg: #34201c;
  --ok: #8fd6a6;
  --interior-1: #7a4f2b;
  --interior-2: #3a2616;
  --interior-3: #1c130c;
  --capiz: url("../img/capiz-night.webp");
  --law-band: #7a3b12;
  --marker: #8a6e55;
  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 24px -18px rgb(0 0 0 / 0.6);
  --shadow-window: 0 1px 3px rgb(0 0 0 / 0.5), 0 26px 44px -26px rgb(255 157 77 / 0.15);
}

@media (min-width: 40em) {
  :root { --gutter: 1.5rem; }
}
@media (min-width: 64em) {
  :root { --gutter: 2rem; }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  font-kerning: normal;
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h2 {
  font-size: var(--step-3);
}

h3 {
  font-size: var(--step-1);
  line-height: 1.25;
}

p {
  margin: 0;
}

p + p {
  margin-top: 1em;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

::selection {
  background: var(--glow);
  color: #241a13;
}

[hidden] {
  display: none !important;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -5rem;
  left: var(--gutter);
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--btn);
  color: var(--on-btn);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ---------- Header: logo plaque and a row of panes ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--hair);
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand toggle"
    "nav nav";
  align-items: center;
  gap: 0.75rem 1rem;
  padding-block: 0.75rem;
}

.brand {
  grid-area: brand;
  justify-self: start;
  display: block;
  padding: 0.35rem 0.6rem;
  background: #ffffff;
  border: 1px solid var(--lattice);
  border-radius: 2px;
}

.brand img {
  width: 5.25rem;
  height: auto;
}

.panes-nav {
  grid-area: nav;
}

.panes-nav ul {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: var(--muntin);
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--lattice);
  border: var(--muntin) solid var(--lattice);
  border-radius: 2px;
}

.panes-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.35rem 0.4rem;
  background: var(--pane);
  color: var(--ink);
  font-size: var(--step--1);
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s var(--ease-out);
}

.panes-nav a:hover {
  background: var(--pane-hover);
}

.panes-nav a:focus-visible {
  outline-offset: -3px;
}

.panes-nav a[aria-current="page"] {
  background: radial-gradient(120% 140% at 50% 0%, var(--paper), var(--pane-lit) 70%);
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--sun);
}

.panes-nav .long {
  display: none;
}

.theme-toggle {
  grid-area: toggle;
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--pane);
}

.theme-toggle svg {
  width: 1.3rem;
  height: 1.3rem;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle[data-mode="dark"] .icon-sun { display: block; }
.theme-toggle[data-mode="dark"] .icon-moon { display: none; }

@media (min-width: 36em) {
  .panes-nav .long { display: inline; }
  .panes-nav a { padding-inline: 0.75rem; }
}

@media (min-width: 60em) {
  .site-header__inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav toggle";
    gap: 1.5rem;
  }
  .panes-nav {
    justify-self: end;
  }
  .panes-nav a {
    padding-inline: 1.1rem;
    font-size: 1rem;
  }
  .brand img {
    width: 6rem;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.7rem 1.35rem;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--btn);
  color: var(--on-btn);
  border: 2px solid var(--btn);
}

.btn--primary:hover {
  background: var(--btn-hover);
  border-color: var(--btn-hover);
}

.btn--quiet {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--wood-hi);
}

.btn--quiet:hover {
  background: var(--pane);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.section + .section {
  border-top: 1px solid var(--hair);
}

.section-head {
  max-width: 40rem;
}

.section-head p {
  margin-top: 1rem;
  color: var(--ink-2);
  font-size: var(--step-1);
  line-height: 1.5;
}

.prose {
  max-width: 40rem;
}

/* ---------- Hero: the capiz window slides open ---------- */

.hero {
  padding-block: clamp(1.5rem, 5vw, 4.5rem) clamp(3.5rem, 7vw, 6rem);
}

/* Phones: title, window, text, actions. Wide: text left, window right. */
.hero__grid {
  display: grid;
  grid-template-areas:
    "title"
    "window"
    "actions"
    "lede";
  align-items: center;
}

.hero__title { grid-area: title; }
.hero__window { grid-area: window; margin-top: 1.25rem; }
.hero__lede { grid-area: lede; }
.hero__actions { grid-area: actions; }

.display {
  font-size: var(--step-4);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.display .line {
  display: block;
}

/* The pun in the name: a band of light behind the lower half of LAW.
   Underlines paint beneath the glyphs, so a thick raised one acts as a highlighter. */
.display .law {
  text-decoration-line: underline;
  text-decoration-color: var(--law-band);
  text-decoration-thickness: 0.3em;
  text-underline-offset: -0.24em;
  text-decoration-skip-ink: none;
}

.lede {
  max-width: 36ch;
  margin-top: 1.5rem;
  color: var(--ink-2);
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.4375rem);
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.window {
  position: relative;
  width: 100%;
  max-width: 26rem;
  margin-inline: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 4px solid var(--wood);
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  background: radial-gradient(90% 70% at 72% 22%, var(--interior-1), var(--interior-2) 58%, var(--interior-3));
  box-shadow: var(--shadow-window);
}

/* Phones: head and shoulders. The cut edge of the photo hides under the frame. */
.window__portrait {
  position: absolute;
  top: -9%;
  right: -2%;
  width: auto;
  max-width: none;
  height: 178%;
  filter: drop-shadow(0 18px 24px rgb(36 26 19 / 0.28));
}

.window__sill {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 3;
  height: 5%;
  background: var(--wood);
}

/* The sliding sash: small square capiz panes, drawn once as an image
   (tools/capiz-texture.py) and moved with a transform only. */
.capiz {
  position: absolute;
  top: 0;
  bottom: 5%;
  left: 0;
  z-index: 2;
  height: auto;
  aspect-ratio: 398 / 888;
  background: var(--capiz) left top / 100% 100% no-repeat;
  border-right: 4px solid var(--wood-hi);
  box-sizing: content-box;
}

@media (prefers-reduced-motion: no-preference) {
  .capiz {
    animation: capiz-slide 1.6s var(--ease-out) 0.35s both;
  }
}

@keyframes capiz-slide {
  from { transform: translateX(105%); }
  to { transform: none; }
}

@media (max-width: 55.99em) {
  .hero__actions { margin-top: 1.25rem; }
  .hero__lede { margin-top: 1.25rem; }
}

@media (min-width: 56em) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    grid-template-rows: 1fr auto auto auto 1fr;
    grid-template-areas:
      ".       window"
      "title   window"
      "lede    window"
      "actions window"
      ".       window";
    column-gap: 4rem;
  }
  .hero__window {
    margin-top: 0;
  }
  /* Square, so the 4x9 sash (44% wide) clears the attorney's face. */
  .window {
    max-width: 31rem;
    margin-inline: auto 0;
    aspect-ratio: 1 / 1;
  }
  .window__portrait {
    top: auto;
    bottom: 0;
    height: 95%;
  }
}

/* ---------- About ---------- */

.about__grid {
  display: grid;
  gap: 1.5rem 4rem;
}

.about__belief {
  max-width: 26ch;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: 1.5rem;
  border-top: 2px solid var(--lattice);
  font-size: var(--step-3);
  font-style: italic;
  line-height: 1.2;
  text-wrap: balance;
}

@media (min-width: 56em) {
  .about__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
  .about__belief {
    grid-column: 2;
  }
}

/* ---------- Services: a list, not a card grid ---------- */

.services__grid {
  display: grid;
  gap: 2rem 4rem;
}

.services__list {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--hair);
}

.service {
  display: grid;
  gap: 0.25rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--hair);
}

.service dt {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: var(--step-1);
  font-weight: 700;
  line-height: 1.25;
}

.service dt::before {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--marker);
}

.service dd {
  margin: 0 0 0 1.15rem;
  color: var(--ink-2);
}

@media (min-width: 40em) {
  .services__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2.5rem;
  }
}

@media (min-width: 56em) {
  .services__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
  }
}

/* ---------- App: the one wood-filled room ---------- */

.app {
  background: var(--band);
  color: var(--ink);
  border-block: 1px solid var(--hair);
}

.section + .app,
.app + .section {
  border-top: 0;
}

.app a {
  color: var(--blue);
}

.app__grid {
  display: grid;
  gap: 2.5rem 4rem;
  align-items: center;
}

.app__text p {
  max-width: 44ch;
  margin-top: 1rem;
  color: var(--ink-2);
  font-size: var(--step-1);
  line-height: 1.5;
}

.link-list {
  display: grid;
  gap: 0.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.link-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 700;
}

.screens {
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0.25rem 0 1rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}

.screens:focus-visible {
  outline-color: var(--blue);
}

.screens li {
  flex: none;
  width: 44%;
  max-width: 12rem;
  scroll-snap-align: start;
}

.screens img {
  width: 100%;
}

@media (min-width: 56em) {
  .app__grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  }
  .screens {
    overflow: visible;
  }
  .screens li {
    flex: 1 1 0;
    width: auto;
  }
  .screens li:nth-child(even) {
    transform: translateY(1.5rem);
  }
}

/* ---------- Contact ---------- */

.contact__grid {
  display: grid;
  gap: 2.5rem 4rem;
  align-items: start;
}

.details {
  display: grid;
  gap: 1rem;
  margin: 2rem 0 0;
}

.details dt {
  color: var(--ink-2);
  font-size: var(--step--1);
}

.details dd {
  margin: 0;
  font-weight: 700;
}

@media (min-width: 56em) {
  .contact__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}

.page-body {
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}

/* ---------- The request form, framed like a window ---------- */

.request-panel {
  container-type: inline-size;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 3px;
  box-shadow: var(--shadow-card);
  padding: clamp(1.1rem, 4vw, 2rem);
  scroll-margin-top: 1rem;
}

.request-panel__title {
  margin-bottom: 1.25rem;
  font-size: var(--step-2);
}

.request-panel__title + .request-panel__intro {
  margin-top: -0.75rem;
}

.request-panel__intro {
  margin-bottom: 1.5rem;
  color: var(--ink-2);
}

.page-intro {
  max-width: 34rem;
  font-size: var(--step-1);
  line-height: 1.55;
}



.field {
  margin: 0 0 1.35rem;
}

.field-row {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 40em) {
  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.field label,
.choice legend {
  display: block;
  margin-bottom: 0.4rem;
  padding: 0;
  font-weight: 700;
  line-height: 1.3;
}

.optional {
  color: var(--ink-2);
  font-weight: 400;
}

.field__hint {
  margin: -0.1rem 0 0.55rem;
  color: var(--ink-2);
  font-size: var(--step--1);
  line-height: 1.45;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  line-height: 1.4;
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

.field [aria-invalid="true"] {
  border-color: var(--err);
  box-shadow: inset 0 0 0 1px var(--err);
}

.field__error {
  margin-top: 0.45rem;
  color: var(--err);
  font-size: var(--step--1);
  font-weight: 700;
  line-height: 1.4;
}

.choice {
  min-width: 0;
  margin: 0 0 1.35rem;
  padding: 0;
  border: 0;
}

.choice__panes {
  display: grid;
  gap: var(--muntin);
  background: var(--lattice);
  border: var(--muntin) solid var(--lattice);
  border-radius: 2px;
}

/* Side by side only when the form itself is wide enough; the page width
   says nothing about a form sitting in a half-width column. */
@container (min-width: 34rem) {
  .choice__panes--3 { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr) minmax(0, 0.8fr); }
  .choice__panes--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.choice__pane {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.65rem 0.85rem;
  background: var(--pane);
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out);
}

.choice__pane:hover {
  background: var(--pane-hover);
}

.choice__pane input {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  background: var(--field);
  border: 2px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.choice__pane input::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--sun);
  transform: scale(0);
  transition: transform 0.18s var(--ease-out);
}

.choice__pane input:checked {
  border-color: var(--wood-hi);
}

.choice__pane input:checked::before {
  transform: scale(1);
}

.choice__pane input:focus-visible {
  outline: none;
}

.choice__pane:has(input:focus-visible) {
  z-index: 1;
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}

.choice__pane:has(input:checked) {
  background: radial-gradient(130% 150% at 50% 0%, var(--paper), var(--pane-lit) 75%);
  font-weight: 700;
}

.choice[aria-invalid="true"] .choice__panes {
  border-color: var(--err);
  background: var(--err);
}

.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: grid;
  gap: 0.9rem;
  align-items: center;
  margin-top: 1.75rem;
}

.form-actions .btn {
  width: 100%;
}

@media (min-width: 40em) {
  .form-actions {
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
  }
  .form-actions .btn {
    width: auto;
  }
}

.form-note {
  color: var(--ink-2);
  font-size: var(--step--1);
  line-height: 1.45;
}

.form-status:not(:empty) {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--err-bg);
  color: var(--ink);
  border: 1px solid var(--err);
  border-radius: 2px;
  font-weight: 700;
}

.form-status:focus {
  outline: none;
}

.form-done {
  padding: clamp(1.1rem, 4vw, 1.75rem);
  background: var(--pane-lit);
  border: 1px solid var(--glow);
  border-radius: 3px;
}

.form-done:focus {
  outline: none;
}

.form-done h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--step-2);
}

.form-done h3::before {
  content: "";
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
  background: var(--sun);
  box-shadow: 0 0 16px 2px var(--glow);
}

.form-done p {
  margin-top: 0.85rem;
}

.form-done .ref {
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.placeholder-note {
  padding: 0.5rem 0.75rem;
  border: 2px dashed var(--sun);
  color: var(--ink);
  font-size: var(--step--1);
}

/* Without JavaScript the inline form cannot get its security token, so it
   is swapped for a link to the server-rendered form. */
.nojs-only {
  display: none;
}

html:not(.js) .js-only {
  display: none;
}

html:not(.js) .nojs-only {
  display: block;
}

/* ---------- Legal documents ---------- */

.doc-head {
  padding-block: clamp(2.25rem, 6vw, 4.5rem) clamp(1.75rem, 4vw, 2.75rem);
}

.doc-head h1 {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.875rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.doc-sub {
  margin-top: 0.6rem;
  color: var(--ink-2);
  font-size: var(--step-2);
  font-style: italic;
  line-height: 1.3;
}

.doc-intro {
  max-width: 42rem;
  margin-top: 1.5rem;
  font-size: var(--step-1);
  line-height: 1.55;
}

.doc-grid {
  display: grid;
  gap: 2rem 4rem;
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}

.toc__title {
  margin-bottom: 0.6rem;
  color: var(--ink-2);
  font-size: var(--step--1);
  font-weight: 700;
}

.toc ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--muntin);
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--lattice);
  border: var(--muntin) solid var(--lattice);
  border-radius: 2px;
}

.toc a {
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 2.75rem;
  padding: 0.45rem 0.7rem;
  background: var(--pane);
  color: var(--ink);
  font-size: var(--step--1);
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.25s var(--ease-out);
}

.toc a:hover {
  background: var(--pane-hover);
}

.toc a:focus-visible {
  outline-offset: -3px;
}

.toc a[aria-current] {
  background: radial-gradient(130% 150% at 0% 50%, var(--paper), var(--pane-lit) 75%);
  font-weight: 700;
}

@media (min-width: 60em) {
  .doc-grid {
    grid-template-columns: 15.5rem minmax(0, 1fr);
    align-items: start;
  }
  .toc {
    position: sticky;
    top: 1.5rem;
  }
  .toc ol {
    grid-template-columns: 1fr;
  }
}

.legal {
  max-width: 42rem;
}

.legal > section {
  padding-block: 1.9rem;
  border-top: 1px solid var(--hair);
  scroll-margin-top: 1.25rem;
}

.legal > section:first-child {
  padding-top: 0;
  border-top: 0;
}

.legal h2 {
  margin-bottom: 1rem;
  font-size: var(--step-2);
}

.legal h3 {
  margin: 1.6rem 0 0.6rem;
}

.legal h2 + h3 {
  margin-top: 0.4rem;
}

.plain-list {
  margin: 1em 0;
  padding: 0;
  list-style: none;
}

.plain-list li + li {
  margin-top: 0.3em;
}

.bullets {
  margin: 1em 0 0;
  padding: 0;
  list-style: none;
}

.bullets li {
  position: relative;
  padding-left: 1.6rem;
}

.bullets li + li {
  margin-top: 1em;
}

.bullets li::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 0.2rem;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--marker);
}

.note-lit {
  margin-top: 1.25rem;
  padding: 0.9rem 1.1rem;
  background: var(--pane-lit);
  border-radius: 2px;
}

.updated {
  margin-top: 2rem;
  color: var(--ink-2);
}

.steps {
  display: grid;
  gap: var(--muntin);
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--lattice);
  border: var(--muntin) solid var(--lattice);
  border-radius: 2px;
}

.steps li {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.95rem 1.1rem;
  background: var(--paper);
}

.step-num {
  color: var(--num);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1;
}

@media (min-width: 40em) {
  .steps--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Two ways to delete, as a window of two (or three) panes */
.paths {
  display: grid;
  gap: var(--muntin);
  margin-top: 2rem;
  background: var(--lattice);
  border: var(--muntin) solid var(--lattice);
  border-radius: 2px;
}

@media (min-width: 40em) {
  .paths { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
}

.paths a {
  display: grid;
  gap: 0.2rem;
  min-height: 3rem;
  padding: 0.9rem 1.1rem;
  background: var(--pane);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s var(--ease-out);
}

.paths a:hover {
  background: var(--pane-lit);
}

.paths a:focus-visible {
  outline-offset: -3px;
}

.paths strong {
  font-size: var(--step-1);
  line-height: 1.25;
}

.paths span {
  color: var(--ink-2);
  font-size: var(--step--1);
}

.deletion-grid {
  display: grid;
  gap: 3rem 4rem;
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}

@media (min-width: 64em) {
  .deletion-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.doc-close {
  margin-top: 1rem;
  padding: 1.25rem 1.35rem;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 3px;
  box-shadow: var(--shadow-card);
}

.doc-close p + p {
  margin-top: 0.5rem;
}

/* Draft wording, visible only in local preview */
.draft {
  position: relative;
  outline: 2px dashed var(--sun);
  outline-offset: 0.75rem;
}

.draft-flag {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.25rem 0.6rem;
  background: var(--pane-lit);
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 700;
  border: 1px solid var(--sun);
}

/* ---------- Footer: the lower wooden panel ---------- */

.site-footer {
  background: var(--band);
  color: var(--ink);
  border-top: 1px solid var(--hair);
  padding-block: 3rem 2.25rem;
}

.site-footer a {
  color: var(--blue);
}

.footer__grid {
  display: grid;
  gap: 2rem;
}

.footer__name {
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.2;
}

.footer__about {
  max-width: 40ch;
  margin-top: 0.6rem;
  color: var(--ink-2);
  font-size: var(--step--1);
}

.footer__nav ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 700;
}

.footer__legal {
  padding-top: 1.5rem;
  border-top: 1px solid var(--hair);
  color: var(--ink-2);
  font-size: var(--step--1);
}

@media (min-width: 48em) {
  .footer__grid {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
  .footer__nav ul {
    grid-template-columns: repeat(2, auto);
    column-gap: 2.5rem;
  }
  .footer__legal {
    grid-column: 1 / -1;
  }
}

/* ---------- Motion and print ---------- */

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

@media print {
  .site-header,
  .site-footer nav,
  .toc,
  .request-panel,
  .paths,
  .skip-link {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .doc-grid,
  .deletion-grid {
    display: block;
  }
  .site-footer {
    background: none;
    color: #000;
  }
}
