/* ==========================================================================
   padlibs 2026
   Bright, playful, light. Self-contained: no webfonts, no CDN, no framework.
   ========================================================================== */

/* --- handwriting faces ------------------------------------------------------
   Bundled locally and declared here rather than constructed in JS. A CSS
   @font-face loads as part of the stylesheet, so it has no CORS or MIME-type
   surprises behind a reverse proxy, and it still works if the app JS never
   runs. font-display: swap means text paints immediately in a fallback if a
   file is ever missing. Keep in step with the FONTS array in notes.js. */

@font-face {
  font-family: "Promised Freedom";
  src: url("fonts/Promised_Freedom.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Snake";
  src: url("fonts/Snake.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "khand";
  src: url("fonts/khand.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Quikhand";
  src: url("fonts/Quikhand.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Brown Bag Lunch";
  src: url("fonts/BrownBagLunch.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Throw My Hands Up in the Air";
  src: url("fonts/Throw_My_Hands_Up_in_the_Air.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Persian";
  src: url("fonts/roya.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hindi";
  src: url("fonts/lekhani_dynamic.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- tokens --------------------------------------------------------------- */

:root {
  color-scheme: light;

  --cream-0: #fffaf5;
  --cream-1: #fff3e8;
  --cream-2: #ffe8d6;

  --surface: #ffffff;
  --surface-sunk: #fff8f2;

  --ink: #2c2118;
  --ink-soft: #7a6757;
  --ink-faint: #a89686;

  --line: #f2e2d3;
  --line-strong: #e6cfba;

  --brand-orange: #ff8a3d;
  --brand-pink: #ff4d8d;
  --brand-violet: #8b5cf6;

  --grad-brand: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-pink) 100%);
  --grad-warm: linear-gradient(135deg, #ffd36e 0%, #ff9a3c 100%);

  --ok: #16a34a;
  --danger: #e11d48;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --sh-sm: 0 1px 2px rgba(120, 72, 40, 0.06), 0 2px 6px rgba(120, 72, 40, 0.05);
  --sh-md: 0 4px 14px rgba(120, 72, 40, 0.08), 0 12px 32px rgba(120, 72, 40, 0.08);
  --sh-lg: 0 18px 50px rgba(120, 72, 40, 0.16);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --shell: 1120px;
  --font-ui: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* --- reset ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream-0);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

img,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* --- decorative background ------------------------------------------------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
}

.aurora span:nth-child(1) {
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  top: -14vw;
  left: -10vw;
  background: #ffc978;
}

.aurora span:nth-child(2) {
  width: 40vw;
  height: 40vw;
  min-width: 280px;
  min-height: 280px;
  top: 22vh;
  right: -12vw;
  background: #ff9ec4;
}

.aurora span:nth-child(3) {
  width: 38vw;
  height: 38vw;
  min-width: 260px;
  min-height: 260px;
  bottom: -14vw;
  left: 28vw;
  background: #cbb6ff;
}

/* --- layout --------------------------------------------------------------- */

.shell {
  width: min(100% - 32px, var(--shell));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 26px 0 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--grad-brand);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  box-shadow: var(--sh-md);
  transform: rotate(-6deg);
}

/* Ink swatches: ballpoint black and ballpoint blue. */
.ink-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.ink-black { background: #24211d; }
.ink-blue  { background: #2440a6; }

[data-theme="windows"] .ink-dot,
[data-theme="original"] .ink-dot {
  border-radius: 0;
}

/* The graffiti banner exists for the Original theme only. */
.brand-banner {
  display: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--sh-sm);
  transition: transform 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.nav-link:hover {
  transform: translateY(-2px);
  color: var(--ink);
  border-color: var(--line-strong);
}

main {
  padding: 26px 0 60px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 46px;
  color: var(--ink-faint);
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

/* --- step scaffolding ----------------------------------------------------- */

.step {
  display: none;
  animation: rise 0.42s var(--ease) both;
}

.step.is-active {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

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

.step-head {
  max-width: 62ch;
  margin-bottom: 26px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.eyebrow b {
  color: var(--brand-pink);
}

h1 {
  margin: 14px 0 8px;
  font-size: clamp(30px, 5.2vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 850;
}

h1 em {
  font-style: normal;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  font-size: clamp(16px, 2.2vw, 18.5px);
  color: var(--ink-soft);
  max-width: 58ch;
}

/* --- step 1: template picker --------------------------------------------- */

.note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.note-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  box-shadow: var(--sh-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.note-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--sh-md);
  border-color: var(--note-accent, var(--brand-orange));
}

/* The radio covers the whole card: it is the click target, stays in the tab
   order, and the card's visible name still comes from the wrapping label. */
.note-card input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.note-card:has(input:checked) {
  border-color: var(--note-accent, var(--brand-orange));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--note-accent, var(--brand-orange)) 22%, transparent),
    var(--sh-md);
  transform: translateY(-5px);
}

.note-card:has(input:focus-visible) {
  outline: 3px solid var(--brand-pink);
  outline-offset: 3px;
}

.note-thumb {
  position: relative;
  aspect-ratio: 762 / 736;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-sunk);
  box-shadow: inset 0 0 0 1px var(--line);
}

.note-thumb canvas {
  width: 100%;
  height: 100%;
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-chip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--note-accent, var(--brand-orange));
  flex: none;
}

.note-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.note-blurb {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* --- buttons -------------------------------------------------------------- */

.btn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  border: 0;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease),
    filter 0.16s var(--ease), opacity 0.16s var(--ease);
}

.btn-primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--sh-md);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--sh-lg);
  filter: saturate(1.08);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: var(--sh-sm);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--surface-sunk);
}

.btn[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

/* --- step 2: customize ---------------------------------------------------- */

.customize {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 30px;
  align-items: start;
}

@media (max-width: 940px) {
  .customize {
    grid-template-columns: minmax(0, 1fr);
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  padding: 22px;
}

@media (max-width: 560px) {
  .panel {
    padding: 17px;
  }
}

.panel > * + * {
  margin-top: 20px;
}

/* Inside the generated note-fields block the siblings are fields and
   fieldsets, which are not direct panel children - they need their own rule. */
.field + .field,
.fieldset + .fieldset,
.field + .fieldset,
.fieldset + .field {
  margin-top: 20px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

select,
input[type="text"],
textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-sunk);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}

select:hover,
input[type="text"]:hover,
textarea:hover {
  border-color: var(--line-strong);
}

select:focus,
input[type="text"]:focus,
textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 4px rgba(255, 77, 141, 0.14);
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
}

.hint {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 6px;
}

.counter {
  float: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: none;
  letter-spacing: 0;
}

.counter.is-near {
  color: var(--brand-orange);
}

.counter.is-full {
  color: var(--danger);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--r-pill);
  background: var(--surface-sunk);
  border: 1.5px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: transform 0.14s var(--ease), background 0.14s var(--ease),
    border-color 0.14s var(--ease), color 0.14s var(--ease);
}

.chip:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

/* Same trick as the note cards: the input is the hit target, so clicking
   anywhere on the chip toggles it and the chip stays keyboard-operable. */
.chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.chip-box {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 2px solid var(--line-strong);
  flex: none;
  position: relative;
  transition: background 0.14s var(--ease), border-color 0.14s var(--ease);
}

.chip:has(input:checked) {
  background: var(--note-accent, var(--brand-orange));
  border-color: var(--note-accent, var(--brand-orange));
  color: #fff;
}

.chip:has(input:checked) .chip-box {
  background: #fff;
  border-color: #fff;
}

.chip:has(input:checked) .chip-box::after {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 0.5px;
  width: 4px;
  height: 8px;
  border: solid var(--note-accent, var(--brand-orange));
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(42deg);
}

.chip:has(input:focus-visible) {
  outline: 3px solid var(--brand-pink);
  outline-offset: 2px;
}

.inline-other {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-other input[type="text"] {
  width: 150px;
  padding: 8px 12px;
  font-size: 14px;
}

/* --- live preview --------------------------------------------------------- */

.preview {
  position: sticky;
  top: 20px;
}

.preview-frame {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-sunk);
  box-shadow: inset 0 0 0 1px var(--line);
}

.preview-frame canvas {
  width: 100%;
  height: auto;
}

.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.preview-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(22, 163, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

/* --- step 3: result ------------------------------------------------------- */

.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 30px;
  align-items: start;
}

@media (max-width: 940px) {
  .result {
    grid-template-columns: minmax(0, 1fr);
  }
}

.share-field {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.share-field input {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--surface-sunk);
}

.result-note {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
}

.result-note strong {
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 24px);
  padding: 12px 22px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  box-shadow: var(--sh-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
  z-index: 60;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.summary-tag {
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--note-accent, var(--brand-orange)) 14%, #fff);
  color: color-mix(in srgb, var(--note-accent, var(--brand-orange)) 78%, #2c2118);
  font-size: 12px;
  font-weight: 700;
}

/* --- theme system -----------------------------------------------------------
   Three themes, picked in the header and applied to <html data-theme="...">:
   light (bubbly, the default), dark (modern, amber accent), retro (Y2K).
   The padlib note cards themselves never change theme - they are the product. */

[data-theme="bubbly"] {
  color-scheme: dark;

  --cream-0: #16121a;
  --cream-1: #1d1823;
  --cream-2: #251e2d;

  --surface: #221b29;
  --surface-sunk: #1a151f;

  --ink: #f6eef7;
  --ink-soft: #c3b2cd;
  --ink-faint: #8f7e9b;

  --line: #362c40;
  --line-strong: #4a3d56;

  --brand-orange: #ffb257;
  --brand-pink: #ff6ba3;
  --brand-violet: #a78bfa;

  --grad-brand: linear-gradient(135deg, #ff9f3d 0%, #ff5f95 100%);
  --grad-warm: linear-gradient(135deg, #ffd36e 0%, #ff9a3c 100%);

  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-md: 0 4px 14px rgba(0, 0, 0, 0.42), 0 12px 32px rgba(0, 0, 0, 0.34);
  --sh-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
}

[data-theme="bubbly"] body {
  background: #16121a;
}

[data-theme="bubbly"] select,
[data-theme="bubbly"] input[type="text"],
[data-theme="bubbly"] textarea,
[data-theme="bubbly"] .share-field input {
  background: #191320;
}

[data-theme="bubbly"] .chip:has(input:checked) .chip-box {
  border-color: #16121a;
}

[data-theme="bubbly"] .aurora span {
  opacity: 0.3;
}

[data-theme="bubbly"] .skip-link {
  background: var(--brand-pink);
  color: #16121a;
}

/* --- retro theme ------------------------------------------------------------- */

[data-theme="windows"] {
  color-scheme: light;

  --cream-0: #008080;
  --cream-1: #c0c0c0;
  --cream-2: #dfdfdf;

  --surface: #c0c0c0;
  --surface-sunk: #d4d0c8;

  --ink: #000000;
  --ink-soft: #1a1a1a;
  --ink-faint: #404040;

  --line: #808080;
  --line-strong: #404040;

  --brand-orange: #000080;
  --brand-pink: #1084d0;
  --brand-violet: #800080;

  --grad-brand: linear-gradient(180deg, #1084d0 0%, #000080 100%);
  --grad-warm: linear-gradient(180deg, #dfdfdf 0%, #a0a0a0 100%);

  --r-sm: 0px;
  --r-md: 2px;
  --r-lg: 3px;
  --r-pill: 2px;

  --sh-sm: 1px 1px 0 #000;
  --sh-md: 2px 2px 0 #000;
  --sh-lg: 3px 3px 0 #000;

  --font-ui: "MS Sans Serif", "Tahoma", "Geneva", Verdana, sans-serif;
}

/* A tiled desktop instead of the soft aurora. */
[data-theme="windows"] body {
  background-color: #008080;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.06) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.06) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

[data-theme="windows"] .aurora {
  display: none;
}

/* Bevels everywhere: raised panels, raised buttons, sunken fields. */
[data-theme="windows"] .panel,
[data-theme="windows"] .note-card {
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  box-shadow: 2px 2px 0 #000;
}

/* Hovering a card lights its bevel in that note's own ink rather than leaving
   it grey, the same treatment the light theme gives the border. */
[data-theme="windows"] .note-card:hover,
[data-theme="windows"] .note-card:has(input:checked) {
  border-color: #ffffff var(--note-accent, #000080) var(--note-accent, #000080) #ffffff;
  box-shadow: 0 0 0 2px var(--note-accent, #000080), 2px 2px 0 #000;
}

[data-theme="windows"] .btn {
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  background: #c0c0c0;
  color: #000;
  border-radius: 0;
  box-shadow: none;
}

[data-theme="windows"] .btn:hover {
  background: #d4d0c8;
  transform: none;
}

[data-theme="windows"] .btn-primary {
  background: linear-gradient(180deg, #1084d0 0%, #000080 100%);
  color: #fff;
  border-color: #ffffff #000040 #000040 #ffffff;
}

[data-theme="windows"] .btn:active:not(:disabled) {
  border-color: #404040 #ffffff #ffffff #404040;
  transform: translate(1px, 1px);
}

[data-theme="windows"] select,
[data-theme="windows"] input[type="text"],
[data-theme="windows"] textarea {
  border: 2px solid;
  border-color: #404040 #ffffff #ffffff #404040;
  background: #ffffff;
  border-radius: 0;
  box-shadow: none;
}

[data-theme="windows"] .brand-mark {
  background: #c0c0c0;
  color: #000080;
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  transform: none;
  border-radius: 0;
  box-shadow: 1px 1px 0 #000;
}

[data-theme="windows"] .brand-name {
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
}

[data-theme="windows"] .brand-tag {
  font-style: italic;
}

/* The classic title-bar gradient behind the wordmark. */
[data-theme="windows"] .site-header {
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  background: linear-gradient(90deg, #000080 0%, #1084d0 55%, #a6caf0 100%);
  padding: 14px 18px;
  box-shadow: 2px 2px 0 #000;
}

[data-theme="windows"] .brand-text .brand-name,
[data-theme="windows"] .brand-text .brand-tag {
  color: #ffffff;
}

[data-theme="windows"] .theme-picker {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  border-radius: 0;
  box-shadow: none;
}

[data-theme="windows"] h1 {
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
  letter-spacing: 0;
}

[data-theme="windows"] h1 em {
  color: #000080;
  background: none;
  -webkit-text-fill-color: #000080;
}

[data-theme="windows"] .eyebrow {
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  background: #c0c0c0;
  border-radius: 0;
  box-shadow: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

[data-theme="windows"] .chip:has(input:checked) {
  background: #000080;
  border-color: #000080;
  color: #fff;
}

[data-theme="windows"] .chip:has(input:checked) .chip-box {
  background: #fff;
  border-color: #fff;
}

[data-theme="windows"] .chip:has(input:checked) .chip-box::after {
  border-color: #000080;
}

[data-theme="windows"] .chip,
[data-theme="windows"] .nav-link,
[data-theme="windows"] .summary-tag {
  border-radius: 0;
}

[data-theme="windows"] .toast {
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  background: #c0c0c0;
  color: #000;
  border-radius: 0;
}

[data-theme="windows"] .site-footer {
  color: #dfe6e6;
}

[data-theme="windows"] .site-footer a,
[data-theme="windows"] .result-note a {
  color: #ffff00;
}

[data-theme="windows"] .field-label,
[data-theme="windows"] legend {
  text-transform: none;
  letter-spacing: 0;
  color: #000;
}

[data-theme="windows"] .hint,
[data-theme="windows"] .lede,
[data-theme="windows"] .result-note,
[data-theme="windows"] .note-blurb,
[data-theme="windows"] .preview-tag {
  color: #1a1a1a;
}

/* --- amber theme -------------------------------------------------------------
   The original padlibs.com palette: black ground, #FFCC33 amber type, and the
   gold graffiti banner back in the header. */

[data-theme="original"] {
  color-scheme: dark;

  --cream-0: #000000;
  --cream-1: #0d0a03;
  --cream-2: #1a1305;

  --surface: #0f0b02;
  --surface-sunk: #050301;

  --ink: #ffcc33;
  --ink-soft: #d9ab2c;
  --ink-faint: #a0801f;

  --line: #3a2d08;
  --line-strong: #6b5312;

  --brand-orange: #ffcc33;
  --brand-pink: #f0c14b;
  --brand-violet: #f8d05a;

  --grad-brand: linear-gradient(135deg, #f8d05a 0%, #e8a81e 100%);
  --grad-warm: linear-gradient(135deg, #ffcc33 0%, #f0c14b 100%);

  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.8);
  --sh-md: 0 4px 14px rgba(0, 0, 0, 0.7), 0 12px 32px rgba(0, 0, 0, 0.6);
  --sh-lg: 0 18px 50px rgba(0, 0, 0, 0.85);
}

[data-theme="original"] body {
  background: #000000;
}

[data-theme="original"] .aurora {
  display: none;
}

/* The banner replaces the gradient tile; the wordmark text stays. */
[data-theme="original"] .brand-banner {
  display: block;
  width: 119px;
  height: 48px;
  image-rendering: auto;
}

[data-theme="original"] .brand-mark {
  display: none;
}

[data-theme="original"] .brand-text .brand-name,
[data-theme="original"] .brand-text .brand-tag {
  color: #ffcc33;
}

[data-theme="original"] .site-header {
  border-bottom: 1px solid #3a2d08;
  padding-bottom: 16px;
}

[data-theme="original"] .nav-link,
[data-theme="original"] .theme-picker {
  background: #0f0b02;
  border-color: #3a2d08;
  color: #d9ab2c;
}

[data-theme="original"] .theme-btn {
  color: #d9ab2c;
}

[data-theme="original"] .theme-btn:hover {
  color: #ffcc33;
  background: #1a1305;
}

[data-theme="original"] .theme-btn[aria-pressed="true"] {
  background: var(--grad-brand);
  color: #1a1305;
}

[data-theme="original"] select,
[data-theme="original"] input[type="text"],
[data-theme="original"] textarea,
[data-theme="original"] .share-field input {
  background: #050301;
  color: #ffcc33;
}

[data-theme="original"] .counter,
[data-theme="original"] .hint,
[data-theme="original"] .lede,
[data-theme="original"] .result-note,
[data-theme="original"] .note-blurb,
[data-theme="original"] .preview-tag {
  color: #d9ab2c;
}


[data-theme="original"] .summary-tag {
  background: rgba(255, 204, 51, 0.12);
  color: #ffcc33;
}

[data-theme="original"] .skip-link {
  background: #ffcc33;
  color: #000000;
}

/* --- y2k theme ----------------------------------------------------------------
   Web 2.0 beta: glossy gradients, rounded corners, Arial, blue and orange. */

[data-theme="y2k"] {
  color-scheme: light;

  --cream-0: #e9eff6;
  --cream-1: #f4f7fb;
  --cream-2: #dde7f1;

  --surface: #ffffff;
  --surface-sunk: #eaf1f8;

  --ink: #24425e;
  --ink-soft: #54748f;
  --ink-faint: #93a9bd;

  --line: #d5e0ea;
  --line-strong: #b7c8d8;

  --brand-orange: #f6861f;
  --brand-pink: #3b7dc4;
  --brand-violet: #5a8fd0;

  /* The hard stop in the middle is the "gloss" of a Web 2.0 button. */
  --grad-brand: linear-gradient(180deg, #7fb2e4 0%, #3f79be 49%, #366dad 51%, #4a85c6 100%);
  --grad-warm: linear-gradient(180deg, #fbae5c 0%, #f6861f 49%, #ef7a12 51%, #f99537 100%);

  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 12px;
  --r-pill: 10px;

  --sh-sm: 0 1px 2px rgba(36, 66, 94, 0.16);
  --sh-md: 0 2px 6px rgba(36, 66, 94, 0.18), 0 8px 20px rgba(36, 66, 94, 0.12);
  --sh-lg: 0 12px 32px rgba(36, 66, 94, 0.24);

  --font-ui: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

[data-theme="y2k"] body {
  background: linear-gradient(180deg, #dfe9f3 0%, #eef3f8 220px, #e9eff6 100%);
  background-attachment: fixed;
}

[data-theme="y2k"] .aurora {
  display: none;
}

/* The beta badge only exists in this theme. */
.beta-badge {
  display: none;
  align-self: flex-start;   /* .brand-text is a column flex box */
}

[data-theme="y2k"] .beta-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbae5c, #ef7a12);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: super;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="y2k"] .brand-text .brand-name {
  color: #2f6fb5;
  font-size: 20px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Glossy buttons: the gradient does the shine, an inset highlight seals it. */
[data-theme="y2k"] .btn {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), var(--sh-md);
}

[data-theme="y2k"] .btn-primary {
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

[data-theme="y2k"] .btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #8fbde9 0%, #4a86c6 49%, #4178b7 51%, #5790cd 100%);
}

/* The Web 2.0 header: a rounded white slab with a gradient strip and a
   reflection underneath. */
[data-theme="y2k"] .site-header {
  background: linear-gradient(180deg, #ffffff 0%, #f2f7fc 100%);
  border: 1px solid #cfdcea;
  border-radius: var(--r-lg);
  padding: 14px 18px;
  box-shadow: var(--sh-md);
  position: relative;
}

[data-theme="y2k"] .site-header::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 100%;
  height: 10px;
  background: linear-gradient(180deg, rgba(36, 66, 94, 0.14), rgba(36, 66, 94, 0));
  pointer-events: none;
}

[data-theme="y2k"] .theme-picker {
  background: linear-gradient(180deg, #f6fafd, #e4edf6);
  border: 1px solid #cfdcea;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="y2k"] .theme-btn[aria-pressed="true"] {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

[data-theme="y2k"] .eyebrow {
  background: linear-gradient(180deg, #ffffff, #e8f0f8);
  border: 1px solid #cfdcea;
  color: #54748f;
}

[data-theme="y2k"] .panel,
[data-theme="y2k"] .note-card {
  box-shadow: var(--sh-md);
}

[data-theme="y2k"] .note-card:hover {
  border-color: var(--note-accent, var(--brand-orange));
}

[data-theme="y2k"] .summary-tag {
  background: #eaf1f8;
  color: #2f6fb5;
  border: 1px solid #cfdcea;
}

[data-theme="y2k"] .site-footer {
  color: #93a9bd;
}

/* --- theme picker ----------------------------------------------------------- */

.theme-picker {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-sm);
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.theme-btn:hover {
  color: var(--ink);
  background: var(--surface-sunk);
}

.theme-btn[aria-pressed="true"] {
  background: var(--grad-brand);
  color: #fff;
}

[data-theme="windows"] .theme-btn[aria-pressed="true"] {
  background: #000080;
  color: #fff;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  flex: none;
}

[data-theme="windows"] .swatch {
  border-radius: 0;
}

.swatch-bubbly  { background: linear-gradient(135deg, #2a2233, #ffb257); }
.swatch-original   { background: linear-gradient(135deg, #000000, #ffcc33); }
.swatch-y2k     { background: linear-gradient(135deg, #3b7dc4, #f6861f); }
.swatch-windows { background: linear-gradient(135deg, #008080, #c0c0c0); }
.swatch-paper   { background: linear-gradient(135deg, #fff8f0, #ffd36e); }


