/* The workspace already uses the original Warm Doodle paper, ink and component styles. */
html[data-theme="warm-journal"] {
  color-scheme: light;
  --canvas: var(--paper-1);
  --surface: var(--paper-0);
  --raised: var(--paper-2);
  --text: var(--ink-1);
  --secondary: var(--ink-2);
  --muted: #6d6153;
  --line: var(--paper-3);
  --blue: var(--indigo);
  --gold: var(--vermilion-deep);
  --glass: var(--paper-0);
  --tape: repeating-linear-gradient(95deg, transparent 0 4px, rgb(255 252 245 / .2) 4px 5px),
          rgb(242 183 5 / .43);

  body::before { content: none; }
  :is(.visual-canvas, .board-shell, .work-preview, .library-unit-portrait-placeholder, .my-no-image) {
    background-image: none;
  }

  :is(.portal-ui, .portal-season-popover, .site-settings-popover) {
    --home-base: var(--canvas); --home-surface: var(--surface); --home-raised: var(--raised);
    --home-ink: var(--text); --home-muted: var(--muted); --home-line: var(--line);
    --home-accent: var(--indigo); --home-on-accent: var(--paper-0); --home-radius: 12px;
    --button-highlight: #f8ebc3; --button-pressed: #f2dea4; --button-highlight-ink: var(--ink-1);
  }
  .portal-bar {
    background: var(--surface); border: 1.5px solid var(--ink-1);
    box-shadow: var(--shadow-s); backdrop-filter: none;
  }
  .portal-brand { font-family: var(--font-display); font-size: 20px; }
  .portal-brand b {
    border: 2px solid var(--ink-1); border-radius: 49% 45% 51% 43%;
    background: var(--vermilion); color: var(--surface); transform: rotate(-6deg);
    box-shadow: var(--shadow-xs); font-family: var(--font-display);
  }
  .portal-hero {
    justify-self: center; align-self: start; align-items: center;
    width: min(1152px, calc(100% - 2 * var(--portal-gutter)));
    min-height: clamp(376px, 53vh, 524px); margin-block: var(--portal-hero-clearance) 32px;
    padding: clamp(32px, 4vw, 64px);
    grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: clamp(24px, 3.2vw, 48px);
    border: 2px solid var(--ink-1); border-radius: 16px 20px 15px 17px;
    background: var(--surface); box-shadow: var(--shadow-l); overflow: visible;
  }
  .portal-hero-paper { display: none; }
  .portal-hero::before, .journal-print::after {
    content: ""; position: absolute; width: 90px; height: 22px;
    border-inline: 1px dashed rgb(43 38 32 / .32); background: var(--tape); pointer-events: none;
  }
  .portal-hero::before { top: -11px; left: 8%; transform: rotate(-4deg); }
  .portal-hero-copy { grid-area: 1 / 1; justify-items: start; width: 100%; margin: 0; text-align: start; }
  .portal-edition { justify-content: flex-start; font-weight: 750; letter-spacing: .07em; }
  .portal-edition:not(:empty)::before { width: 22px; height: 2px; }
  .portal-hero h1 {
    position: relative; isolation: isolate; width: fit-content; max-width: 100%;
    color: var(--ink-1); font: 400 clamp(46px,5.9vw,84px)/1.2 var(--font-display);
    letter-spacing: .025em; overflow-wrap: anywhere;
  }
  .portal-hero h1::after {
    content: ""; position: absolute; z-index: -1; inset: 70% -2px 4%;
    background: rgb(242 183 5 / .49); transform: rotate(-1.5deg);
    border-radius: 45% 7% 20% 2% / 12% 10% 52% 40%;
  }
  .portal-subtitle { color: var(--ink-2); line-height: 1.65; font-size: clamp(15px,1.4vw,19px); }
  .portal-actions { justify-content: flex-start; }
  .portal-actions .portal-cta {
    border: 2px solid var(--ink-1); border-radius: 9px; padding: 9px 15px;
    min-height: 46px; white-space: normal; box-shadow: var(--shadow-s); line-height: 1.35;
  }
  .portal-actions .portal-cta-main {
    background: var(--vermilion-deep); color: var(--paper-0);
    --button-highlight: #a33329; --button-pressed: #8d3028; --button-highlight-ink: var(--paper-0);
  }
  .portal-actions .portal-cta-alt { color: var(--indigo); background: var(--paper-0); }
  .journal-print {
    position: relative; grid-area: 1 / 2; display: grid; width: 100%; max-width: 416px;
    margin: 0; padding: 10px 10px 0; border: 1.5px solid var(--ink-1); border-radius: 3px;
    background: var(--surface); box-shadow: var(--shadow-m); transform: rotate(3deg);
  }
  .journal-print::after { top: -10px; left: calc(50% - 42px); width: 84px; transform: rotate(-8deg); }
  .journal-print-art {
    aspect-ratio: 1.47; border: 1px solid var(--ink-2);
    background: var(--paper-2) url('/assets/landing/ahri.jpg') 65% center / cover no-repeat;
  }
  .journal-print figcaption {
    padding: 9px 3px 11px; color: var(--ink-2); font: 400 16px/1.35 var(--font-display);
    text-align: end; letter-spacing: .05em;
  }
  .portal-season-popover, .site-settings-popover {
    border: 1.5px solid var(--ink-1); box-shadow: var(--shadow-m);
  }
  .site-settings-theme-tabs .site-settings-theme-option:has(input:checked) {
    border-color: var(--indigo); background: var(--indigo); color: var(--paper-0); box-shadow: var(--shadow-xs);
  }
  .site-settings-option:has(input:checked) { background: #f7ecd0; }
  .portal-ui :is(button,a):focus-visible, :is(a,button,select,input,textarea,[tabindex]):focus-visible,
  .site-settings-popover label:has(input:focus-visible) {
    outline: 2px solid var(--indigo); outline-offset: 2px; box-shadow: 0 0 0 5px rgb(242 183 5 / .5);
  }
  .portal-season-popover :is(a,button):focus-visible { outline-offset: -2px; }
  .select-control.game-select-control { position: absolute; width: 1px; }
  .season-control { display: flex; align-items: center; min-width: 0; }
  .season-control > svg { position: absolute; left: 11px; width: 15px; pointer-events: none; color: var(--paper-0); }
  .global-controls .season-control select { color: var(--paper-0); background: var(--vermilion-deep); text-overflow: ellipsis; }
  .item-card .item-type-tag { color: var(--indigo); background: var(--paper-0); }
  .context-copy { min-width: 0; }
  .library-check:has(input:checked) { border-color: var(--indigo); background: #f5eedc; }
  .jcc-library-group-head h2, .jcc-unit-card-cost, .jcc-dossier-stat-value { font-variant-numeric: tabular-nums; }
  .ink-ripple { animation-duration: 300ms; }
  @media (hover: hover) and (pointer: fine) {
    .portal-actions .portal-cta:hover { color: var(--button-highlight-ink); background: var(--button-highlight); }
    @media (prefers-reduced-motion: no-preference) {
      .portal-actions .portal-cta { transition: transform 160ms var(--out), box-shadow 160ms var(--out), background-color 160ms; }
      .portal-actions .portal-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
    }
  }
  .portal-actions .portal-cta:is(:active,[data-touch-pressed],[aria-expanded="true"]) {
    background: var(--button-pressed); color: var(--button-highlight-ink); box-shadow: var(--shadow-xs);
  }
  @media (prefers-reduced-motion: no-preference) {
    .portal-actions .portal-cta:is(:active,[data-touch-pressed]) { transform: translate(2px,2px); box-shadow: none; }
  }
  @media (min-width: 901px) { .mobile-menu { display: none; } }
  @media (max-width: 900px) {
    .app-sidebar { visibility: hidden; }
    .sidebar-open .app-sidebar { visibility: visible; }
  }
  @media (max-width: 700px) {
    .context-main-row .global-controls { display: grid; grid-template-columns: auto auto auto minmax(0,1fr); gap: 6px; }
    .global-controls .season-control select { width: 100%; min-width: 0; padding-inline-end: 4px; }
    .portal-hero {
      width: min(500px, calc(100% - 2 * var(--portal-gutter))); grid-template-columns: minmax(0,1fr);
      gap: 24px; min-height: 0; padding: 24px 16px 20px;
    }
    .portal-hero h1 { font-size: clamp(44px,11vw,60px); }
    .portal-actions .portal-cta { min-height: 44px; padding: 8px; font-size: 14px; }
    .journal-print { grid-area: 2 / 1; width: 88%; max-width: 282px; padding: 6px 6px 0; transform: rotate(2deg); }
    .journal-print-art { aspect-ratio: 2.05; background-position-y: 36%; }
    .journal-print figcaption { padding: 5px 2px 7px; font-size: 14px; }
  }
  @media (pointer: coarse) {
    .jcc-library-tools :is(input[type=search],select,button), .jcc-unit-list-options .library-check,
    .category-strip .category-button, .unit-pool .filter-chip { min-height: 44px; }
  }
  @media (prefers-reduced-motion: reduce) {
    &, *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .ink-ripple { display: none; }
  }
}
