@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/InstrumentSerif-Latin.woff2') format('woff2');
  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 Serif';
  src: url('fonts/InstrumentSerif-LatinExt.woff2') format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@media screen {
  :root[data-desktop-theme="aqua-studio"] {
    --wall-color: #b7cdea;
    --wall-art: radial-gradient(ellipse at 27% -25%, #fff 0, transparent 56%), linear-gradient(135deg, #e7f2ff, #c3d8f2 60%, #98b9e0);
    --wall-texture: repeating-linear-gradient(0deg, #ffffff32 0 1px, transparent 1px 4px);
    --shell-ink: #172e4b;
    --shell-muted: #425875;
    --shell-line: #9bb2cf;
    --highlight: #e0efff;
    --accent: #19538d;
    --shell-chrome: linear-gradient(#fcfdff, #d9e1ec 50%, #cbd7e7 51%, #e4edf8);
    --toolbar-fill: repeating-linear-gradient(0deg, #ffffff22 0 1px, transparent 1px 3px), linear-gradient(#f7faff, #c9d5e5);
    --tray-fill: linear-gradient(145deg, #f7fbffc9, #dbe8fa92 53%, #d0e1f8bd);
    --tray-shadow: 0 1px #fffe inset, 0 23px 52px #1c427129;
    --window-shadow: 0 24px 70px #15396247;
    --reader-rail: #eaf2fd;
    --reader-ink: #27415d;
    --reader-current: #c9dffc;
    --reader-line: #c4d5ec;
    --aqua-blue: linear-gradient(#effaff, #abd6ff 49%, #84bdf6 50%, #c1e9ff);
    --aqua-silver: linear-gradient(#fff, #e3ebf7 46%, #d2ddeb 50%, #f5f9ff);
    --pill-ink: #102f50;
    --accent-line: #638ec1;
    --button-radius: 999px;
    --panel-radius: 18px;
    --title-font: var(--desk-font);
    --headline-weight: 550;
    --headline-size: clamp(30px, 3.25vw, 52px);
    --greeting-fill: linear-gradient(#f4fbff, #b7d9ff 47%, #9bc8fb 49%, #d2efff);
    --greeting-border: #7396ca;
    --greeting-shadow: 0 1px 2px #fff inset, 0 12px 22px #10488428;
    --work-window: #f8fbff;
    --read-paper: #fff;
    --chat-fill: #eaf1fc;
    --chat-mine: #d4e6ff;
    --card-fill: linear-gradient(#fcfdff, #edf4ff);
  }

  :root[data-desktop-theme="graphite"] {
    --wall-color: #1a1b24;
    --wall-art: radial-gradient(ellipse at 13% 95%, #4a3b5e80, transparent 54%), radial-gradient(ellipse at 90% 5%, #38728245, transparent 49%), linear-gradient(155deg, #181921, #24232f 70%, #181a24);
    --wall-texture: radial-gradient(circle, #c5badf32 .7px, transparent 1px) 0 0 / 23px 23px;
    --shell-ink: #f0eef4;
    --shell-muted: #c1bccd;
    --shell-line: #605b70;
    --highlight: #423c55;
    --accent: #c8b6ff;
    --shell-chrome: linear-gradient(#33313e, #24232e);
    --toolbar-fill: linear-gradient(#393644, #2c2a36);
    --tray-fill: linear-gradient(150deg, #32313e, #272633);
    --tray-shadow: 0 1px #ffffff16 inset, 0 23px 59px #08071164;
    --window-shadow: 0 24px 70px #08070cb0;
    --reader-rail: #302d3b;
    --reader-ink: #efe9f8;
    --reader-current: #4d4564;
    --reader-line: #544d64;
    --aqua-blue: linear-gradient(#e3d8ff, #c3aff6);
    --aqua-silver: linear-gradient(#413c51, #343043);
    --pill-ink: #241a3b;
    --accent-line: #aa95df;
    --button-radius: 8px;
    --panel-radius: 15px;
    --title-font: var(--desk-font);
    --headline-weight: 500;
    --headline-size: clamp(34px, 4.35vw, 66px);
    --greeting-fill: transparent;
    --greeting-border: transparent;
    --greeting-shadow: none;
    --work-window: #26242f;
    --read-paper: #fff;
    --chat-fill: #34313f;
    --chat-mine: #413655;
    --card-fill: #353240;
  }

  :root[data-desktop-theme="paper"] {
    --wall-color: #f4eddd;
    --wall-art: radial-gradient(ellipse at 51% 16%, #fffff7, transparent 64%), linear-gradient(156deg, #f1e6d2, #eee5d5 67%, #dfd1b7);
    --wall-texture: radial-gradient(circle, #80715326 .6px, transparent 1px) 0 0 / 19px 19px;
    --shell-ink: #352d23;
    --shell-muted: #63574b;
    --shell-line: #cabb9f;
    --highlight: #f3e7c9;
    --accent: #775016;
    --shell-chrome: linear-gradient(#fffaf0, #f0e6d5);
    --toolbar-fill: #f2ebe0;
    --tray-fill: #fffaf1d9;
    --tray-shadow: 0 1px #fff inset, 0 16px 42px #614c2921;
    --window-shadow: 0 22px 60px #4c381a32;
    --reader-rail: #f2ede4;
    --reader-ink: #45372b;
    --reader-current: #ecdfbe;
    --reader-line: #ded2bd;
    --aqua-blue: linear-gradient(#ffeab3, #ecd291);
    --aqua-silver: #fffcf6;
    --pill-ink: #3e2d16;
    --accent-line: #b29357;
    --button-radius: 6px;
    --panel-radius: 9px;
    --title-font: 'Instrument Serif', Georgia, serif;
    --headline-weight: 400;
    --headline-size: clamp(42px, 5.2vw, 74px);
    --greeting-fill: transparent;
    --greeting-border: transparent;
    --greeting-shadow: none;
    --work-window: #fffcf6;
    --read-paper: #fffefa;
    --chat-fill: #f1ebe1;
    --chat-mine: #f5e9c6;
    --card-fill: #fffaf1;
  }

  html { background: var(--wall-color); }
  .wallpaper { background: var(--wall-texture), var(--wall-art); }
  :where(a, button, input, [tabindex]):focus-visible { outline-color: var(--accent-line); }

  .menubar {
    background: var(--shell-chrome);
    color: var(--shell-ink);
    box-shadow: 0 1px var(--shell-line), 0 1px #ffffff35 inset;
  }
  .menu-shortcuts button, .menu-tools time, .menu-location, .window-kind { color: var(--shell-muted); }
  .menu-divider, .dock-divider { background: var(--shell-line); box-shadow: none; }
  .menubar button:hover { background: var(--highlight); }
  .languages, .login .languages, .login .lock-glyph {
    color: var(--shell-ink);
    background: var(--shell-chrome);
    border-color: var(--shell-line);
  }
  .languages button[aria-pressed=true], .login .languages button[aria-pressed=true] {
    color: var(--shell-ink);
    background: var(--highlight);
    box-shadow: 0 0 0 1px var(--shell-line) inset;
  }

  .login, .login-profile { color: var(--shell-ink); text-shadow: none; background: none; }
  .login-clock { font-family: var(--title-font); text-shadow: none; }
  .login-clock time { font-weight: var(--headline-weight); }
  .login .lv {
    color: var(--pill-ink);
    background: var(--aqua-blue);
    border-color: var(--accent-line);
    box-shadow: 0 1px #fff9 inset, 0 9px 25px #0003;
  }

  .aqua, .login .aqua {
    --pill-border: var(--accent-line);
    color: var(--pill-ink);
    border-radius: var(--button-radius);
    font-weight: 600;
    text-shadow: none;
    box-shadow: 0 1px #ffffff80 inset, 0 3px 7px #13121a1a;
  }
  .aqua.aqua-secondary {
    --pill-border: var(--shell-line);
    color: var(--shell-ink);
  }
  .aqua::after { border-bottom: 0; }
  .aqua:hover, .login-profile:hover .aqua { box-shadow: 0 1px #fff9 inset, 0 4px 12px #13121a26; }
  .editorial-actions a.aqua { box-shadow: none; }

  :where(html:not([data-desktop-layout="classic"])) .desktop-body {
    display: grid;
    width: min(100%, 1350px);
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    grid-template-areas: "welcome apps" "note apps";
    gap: 16px clamp(24px, 5vw, 78px);
    align-content: center;
    padding: clamp(26px, 4vw, 58px);
  }
  :where(html:not([data-desktop-layout="classic"])) .welcome {
    grid-area: welcome;
    align-self: end;
    position: relative;
    inset: auto;
    width: auto;
    max-width: none;
    min-width: 0;
    transform: none;
    text-align: left;
  }
  .welcome .welcome-message {
    color: var(--shell-ink);
    background: var(--greeting-fill);
    border-color: var(--greeting-border);
    box-shadow: var(--greeting-shadow);
    font-family: var(--title-font);
    font-weight: var(--headline-weight);
    text-shadow: none;
  }
  :where(html:not([data-desktop-layout="classic"])) .welcome .welcome-message {
    padding: var(--greeting-padding, 14px 19px);
    min-height: 0;
    font-size: var(--headline-size);
    line-height: 1.03;
    letter-spacing: -.049em;
    text-wrap: balance;
  }
  :where(html:not([data-desktop-layout="classic"][data-desktop-theme="aqua-studio"])) .welcome-message::after { display: none; }
  .welcome-message[data-typing] [data-welcome-text]::after { background: var(--accent); }
  .welcome p { color: var(--shell-muted); }
  :where(html:not([data-desktop-layout="classic"])) .welcome p { font-size: clamp(14px, 1.25vw, 18px); line-height: 1.4; }
  :where(html:not([data-desktop-layout="classic"])) .welcome-actions { justify-content: flex-start; gap: 8px; margin-top: 19px; }
  :where(html:not([data-desktop-layout="classic"])) .welcome-actions .aqua { padding-inline: 13px; min-height: 40px; font-size: 14px; }

  :where(html:not([data-desktop-layout="classic"])) .launchpad {
    grid-area: apps;
    align-self: center;
    position: relative;
    inset: auto;
    padding: clamp(12px, 2.25vw, 27px);
    background: var(--tray-fill);
    border: 1px solid var(--shell-line);
    border-radius: var(--panel-radius);
    box-shadow: var(--tray-shadow);
  }
  :where(html:not([data-desktop-layout="classic"])) .launch-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(5px, .9vw, 13px);
    height: auto;
  }
  .launch-app { color: var(--shell-ink); }
  :where(html:not([data-desktop-layout="classic"])) .launch-app {
    position: static;
    width: auto;
    min-height: 82px;
    padding: 6px 3px;
    transform: none;
    border-radius: 8px;
  }
  :where(html:not([data-desktop-layout="classic"])) .launch-app strong { font-size: 12px; font-weight: 600; }
  .launch-app small { color: var(--shell-muted); }
  :where(html:not([data-desktop-layout="classic"])) .launch-app[data-project] small { display: none; }
  .launch-app:hover, .launch-app:focus-visible { background: var(--highlight); border-color: var(--shell-line); outline-color: var(--accent-line); }
  :where(html:not([data-desktop-layout="classic"])) .launch-app .app-icon { width: 48px; height: 48px; }
  .mini-window {
    background: var(--shell-chrome);
    border-color: var(--shell-line);
    box-shadow: 0 5px 13px #12162633;
  }
  :where(html:not([data-desktop-layout="classic"])) .mini-window { width: min(100%, 112px); }
  :where(html:not([data-desktop-layout="classic"])) .mini-window video { max-height: 71px; }
  .desk-note {
    background: var(--tray-fill);
    color: var(--shell-muted);
    border-color: var(--shell-line);
  }
  :where(html:not([data-desktop-layout="classic"])) .desk-note {
    grid-area: note;
    align-self: start;
    justify-self: start;
    position: static;
    width: auto;
    margin: 0;
    padding: 8px 13px;
    transform: none;
    border-radius: 8px;
    box-shadow: none;
  }
  :where(html:not([data-desktop-layout="classic"])) :is(.desk-note > span, .note-pin) { display: none; }
  :where(html:not([data-desktop-layout="classic"])) .desk-note p { margin: 0; font-size: 11px; font-weight: 500; white-space: pre-line; }
  :where(html[data-desktop-layout="classic"]) .desk-note > span { color: var(--shell-ink); }

  .dock {
    border-color: var(--shell-line);
    border-radius: var(--panel-radius);
    background: var(--shell-chrome);
    box-shadow: var(--tray-shadow);
  }
  .dock .dock-home { color: var(--shell-ink); }
  .dock .dock-home svg { filter: none; }
  .dock button[data-running=true]::after { background: var(--accent); box-shadow: none; }
  .dock-label { color: var(--shell-ink); background: var(--shell-chrome); border-color: var(--shell-line); }

  .app-window, .app-window[data-reader=true] {
    background: var(--shell-chrome);
    border-color: var(--shell-line);
    border-radius: var(--panel-radius);
  }
  .app-window[data-focused=true] { box-shadow: var(--window-shadow); }
  .window-bar, .app-window[data-reader=true] .window-bar {
    background: var(--toolbar-fill);
    color: var(--shell-ink);
    border-color: var(--shell-line);
    box-shadow: 0 1px #ffffff30 inset;
  }
  .window-name { font-weight: 650; text-shadow: none; }
  .reader-toggle, .reader-tools button { color: var(--shell-ink); }
  .reader-toggle:hover, .reader-tools button:hover { background: var(--highlight); border-color: var(--shell-line); box-shadow: none; }
  .window-body { color: var(--shell-ink); background: var(--work-window); }
  .app-window[data-reader=false] .window-body { border-color: var(--shell-line); box-shadow: none; }
  .window-intro p, .chat-hint { color: var(--shell-muted); }
  .editorial-card, .editorial-card-title { color: var(--shell-ink); background: var(--card-fill); border-color: var(--shell-line); }
  .editorial-card-title small { color: var(--shell-muted); }
  .editorial-card:hover { border-color: var(--accent-line); }
  .editorial-index h2, .editorial-heading h1, .window-body:not(.reader-body) .window-intro h2, .chat-header h2 {
    font-family: var(--title-font);
    font-weight: var(--headline-weight);
    letter-spacing: -.035em;
  }

  .reader-body, .reader-paper:has(.editorial-case) { background: var(--read-paper); color: var(--ink); }
  .reader-sidebar { color: var(--reader-ink); background: var(--reader-rail); border-color: var(--reader-line); }
  .reader-identity { border-color: var(--reader-line); }
  .reader-identity small, .reader-index a, .reader-index a span { color: var(--reader-ink); }
  .reader-index a:hover, .reader-index a[aria-current] { color: var(--reader-ink); background: var(--reader-current); }
  .reader-index a[aria-current] span { color: var(--reader-ink); }
  .editorial-case .reader-next button, .editorial-case .reader-next button:hover { color: var(--ink); background: #f3f1ed; }

  .chat-reply, .chat-form { color: var(--shell-ink); background: var(--chat-fill); border-color: var(--shell-line); }
  .chat-mine { color: var(--shell-ink); background: var(--chat-mine); }
  .chat-form input { border-color: var(--shell-line); }
  .app-window[data-window="cv"] .window-body, .gallery-paper { color: var(--ink); }
  .gallery-paper p { color: var(--quiet); }

  [data-desktop-theme="aqua-studio"]:where(:not([data-desktop-layout="classic"])) .launchpad {
    padding-top: clamp(23px, 3vw, 40px);
  }
  [data-desktop-theme="aqua-studio"] .welcome .welcome-message { color: #101827; }
  [data-desktop-theme="aqua-studio"]:where(:not([data-desktop-layout="classic"])) .launchpad::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 15px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cf6873;
    box-shadow: 12px 0 #d9ab56, 24px 0 #6aa38c;
  }
  [data-desktop-theme="aqua-studio"][data-desktop-layout="classic"] .welcome-message {
    --bubble-border: var(--greeting-border);
    --bubble-base: #d2efff;
  }
  [data-desktop-theme="graphite"] {
    --greeting-padding: 0;
  }
  [data-desktop-theme="graphite"]:where(:not([data-desktop-layout="classic"])) .desktop-body {
    grid-template-areas: "apps welcome" "apps note";
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  }
  [data-desktop-theme="graphite"] .welcome-message::before, [data-desktop-theme="paper"] .welcome-message::before { display: none; }
  [data-desktop-theme="graphite"]:where(:not([data-desktop-layout="classic"])) .launch-app { background: #ffffff06; }
  [data-desktop-theme="graphite"] .launch-app:hover, [data-desktop-theme="graphite"] .launch-app:focus-visible { background: var(--highlight); }
  [data-desktop-theme="graphite"] .aqua::after { border-top-color: #ffffff2e; }
  [data-desktop-theme="graphite"] .chat-form input { background: #25232e; color: var(--shell-ink); }
  [data-desktop-theme="graphite"] .chat-form input::placeholder { color: var(--shell-muted); }
  [data-desktop-theme="graphite"] .editorial-actions .aqua-secondary { --pill-border: #605b70; }
  [data-desktop-theme="paper"]:where(:not([data-desktop-layout="classic"])) .desktop-body {
    --greeting-padding: 0;
    width: min(100%, 1035px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "welcome" "apps" "note";
    gap: 16px;
  }
  [data-desktop-theme="paper"]:where(:not([data-desktop-layout="classic"])) :is(.welcome, .welcome-message) { text-align: center; }
  [data-desktop-theme="paper"]:where(:not([data-desktop-layout="classic"])) .welcome-actions { justify-content: center; }
  [data-desktop-theme="paper"]:where(:not([data-desktop-layout="classic"])) .desk-note { justify-self: center; background: transparent; border-color: transparent; }
  [data-desktop-theme="paper"][data-desktop-layout="classic"] .welcome .welcome-message {
    font-size: clamp(25px, 3vw, 36px);
  }
  [data-desktop-theme="paper"] .editorial-heading h1 { font-size: clamp(40px, 5vw, 60px); }
  [data-desktop-theme="paper"] .editorial-case h2 { font-family: var(--title-font); font-weight: 400; font-size: clamp(28px, 3.1vw, 38px); }

  @media (min-width: 1060px) {
    :where(html:not([data-desktop-layout="classic"])) .launch-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  }
  @media (min-width: 721px) {
    [data-desktop-theme="paper"]:where(:not([data-desktop-layout="classic"])) .launch-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  }
  @media (max-width: 720px) {
    :where(html:not([data-desktop-layout="classic"])) .desktop-body,
    :is([data-desktop-theme="graphite"], [data-desktop-theme="paper"]):where(:not([data-desktop-layout="classic"])) .desktop-body {
      grid-template-columns: minmax(0, 1fr);
      grid-template-areas: "welcome" "apps" "note";
      padding: 30px 13px 20px;
      gap: 16px;
    }
    :where(html:not([data-desktop-layout="classic"])) .launch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    :where(html:not([data-desktop-layout="classic"])) .launch-app { min-height: 70px; }
    :where(html:not([data-desktop-layout="classic"])) .launch-app .app-icon { width: 43px; height: 43px; }
    :where(html:not([data-desktop-layout="classic"])) .welcome-actions { margin-top: 14px; }
    .app-window[data-reader=true] .window-bar { border-radius: 8px 8px 0 0; }
  }
  @media (pointer: coarse) {
    :where(html:not([data-desktop-layout="classic"])) .welcome-actions .aqua { min-height: 44px; }
  }
}
