/* Shared desktop components. Content and editor data live outside this theme. */
body:not(.admin) {
  --ink: #49362e;
  --muted: #735d52;
  --cream: #fff7e9;
  --paper: #fffcf5;
  --pink: #dba0b3;
  --yellow: #e8bd5e;
  --line: #b4a08d;
  --chrome: #ded4c8;
  --focus: #744966;
  --ui: Tahoma, "DM Sans", sans-serif;
  --mono: var(--ui);
  --reading: "DM Sans", Tahoma, sans-serif;
  --dock-clearance: 126px;
  grid-template-rows: minmax(0, 1fr);
  background: var(--pink);
  color-scheme: light;
  font: 1rem/1.55 var(--reading);
  -webkit-tap-highlight-color: #74496622;
}

button, a, summary {
  touch-action: manipulation;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--focus);
  border-radius: 4px;
  transform: translateY(-150%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

#desktop {
  background:
    radial-gradient(ellipse at 5% 95%, #f4d9b7 0, transparent 62%),
    radial-gradient(ellipse at 95% 15%, #e5b5c5 0, transparent 60%),
    linear-gradient(125deg, #cdb4ab, #bd839c 68%, #a77996);
}

#desktop::before {
  inset: -20%;
  background: repeating-radial-gradient(
    ellipse at 3% 110%,
    transparent 0 55px,
    #fff5df15 56px 57px,
    transparent 58px 95px
  );
  transform: rotate(-12deg);
}

#shortcuts {
  padding: 24px 16px;
}

.desktop-apps {
  grid-template-columns: 108px;
  gap: 15px;
}

.file-button {
  min-width: 100px;
  min-height: 100px;
  padding: 10px 6px;
  gap: 8px;
  border-radius: 4px;
  font: 0.875rem/1.3 var(--ui);
}

.desktop-apps .file-button {
  width: 108px;
  color: var(--ink);
  background: transparent;
  text-shadow: none;
}

.desktop-apps .file-button > span:last-child {
  max-width: 100%;
  padding: 2px 5px;
  background: #fff7e9cf;
  border-radius: 3px;
  overflow-wrap: anywhere;
}

.file-button:hover, .desktop-apps .file-button:hover {
  background: #fff7e938;
  border-color: #fff7e97a;
}

.file-button.file-selected {
  background: #7449663d;
  border-color: #744966;
  box-shadow: inset 0 0 0 1px #fff7e97a;
}

#windows {
  inset: 0;
}

/* Every application uses the same title bar, geometry and focus treatment. */
.window {
  left: var(--win-x);
  top: var(--win-y);
  width: var(--win-width, min(700px, calc(100% - 32px)));
  height: var(--win-height, min(720px, calc(100% - 134px)));
  max-width: calc(100% - var(--win-x) - 12px);
  max-height: calc(100% - var(--win-y));
  border: 1px solid #ab9689;
  border-radius: 8px 8px 4px 4px;
  background: var(--cream);
  box-shadow: 0 8px 18px #49362e2b, 0 1px 3px #49362e55;
}

.window[data-window="profile"] {
  width: var(--win-width, min(1060px, calc(100% - 160px)));
  height: var(--win-height, min(760px, calc(100% - 134px)));
}

.window.focused {
  border-color: #866678;
  box-shadow: 0 15px 30px #49362e3d, 0 2px 5px #49362e5c;
}

.window:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.window.maximized, .window[data-window="profile"].maximized {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.titlebar, .focused .titlebar {
  position: relative;
  min-height: 36px;
  flex-shrink: 0;
  justify-content: center;
  padding: 0 110px;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, #ffffff29 0 1px, transparent 1px 3px),
    linear-gradient(#faf7f1, #ded4c8 48%, #cbbeb2 51%, #e8dfd5);
  border-bottom: 1px solid #ac9688;
  box-shadow: inset 0 1px #fff9;
}

.window:not(.focused) .titlebar {
  color: #776a62;
  background: linear-gradient(#f4eee7, #ded5ca);
  border-bottom-color: #b9ab9f;
}

.window-title {
  display: block;
  max-width: 100%;
  font: 700 0.875rem/1.3 var(--ui);
  text-shadow: 0 1px #fff9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-title .icon {
  display: none;
}

.window-controls {
  position: absolute;
  left: 5px;
  top: 4px;
  gap: 1px;
}

.window-controls button,
.window-controls button[data-win-action="close"],
.window-controls button:hover {
  position: relative;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  font-size: 0;
}

.window-controls button::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid #9b6272;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 18%, #fff9, transparent 60%),
    linear-gradient(#eda9bb, #c77d95 70%, #f4bfd0);
  box-shadow: inset 0 1px #fffb, 0 1px #fff8;
}

.window-controls button[data-win-action="close"] { order: 0; }
.window-controls button[data-win-action="minimize"] { order: 1; }
.window-controls button[data-win-action="maximize"],
.window-controls button[data-win-action="restore"] { order: 2; }

.window-controls button[data-win-action="minimize"]::before {
  border-color: #ac8c48;
  background: radial-gradient(ellipse at 50% 18%, #fff9, transparent 60%),
    linear-gradient(#ffe19a, #d8ae52 70%, #ffe5a6);
}

.window-controls button[data-win-action="maximize"]::before,
.window-controls button[data-win-action="restore"]::before {
  border-color: #7e8766;
  background: radial-gradient(ellipse at 50% 18%, #fff9, transparent 60%),
    linear-gradient(#dce0b9, #a9b383 70%, #e4e9c9);
}

.window-controls button::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  color: #49362e;
  font: 700 13px/1 var(--ui);
}

.window-controls button[data-win-action="close"]::after { content: "×"; }
.window-controls button[data-win-action="minimize"]::after { content: "−"; }
.window-controls button[data-win-action="maximize"]::after { content: "+"; }
.window-controls button[data-win-action="restore"]::after { content: "−"; }
.window-controls:hover button::after,
.window-controls button:focus-visible::after { opacity: 1; }

.window-controls button:active::before {
  filter: brightness(.88);
  box-shadow: inset 0 1px 2px #49362e66;
}

.window:not(.focused) .window-controls button::before { opacity: .65; }

.window-body {
  font: 1rem/1.55 var(--reading);
  scroll-padding-block-end: var(--dock-clearance);
}

.window-body:not(.browser-body), .browser-scroll {
  padding-bottom: var(--dock-clearance);
}

/* Compact, readable browser controls with the same raised/inset vocabulary. */
.browser-tools {
  flex-shrink: 0;
  gap: 10px;
  min-height: 46px;
  padding: 6px 12px;
  background: linear-gradient(#eee7de, #ded4c8);
  border-bottom: 1px solid #b6a496;
}

.browser-arrows { gap: 0; }

.browser-arrows button {
  width: 32px;
  height: 30px;
  padding: 0;
  border-color: #ac9789;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(#fffaf2, #ded1c1);
  box-shadow: inset 0 1px #fffb;
  font: 700 1rem var(--ui);
}

.browser-arrows button + button {
  border-left: 0;
  border-radius: 0 4px 4px 0;
}

.address {
  min-width: 0;
  min-height: 30px;
  padding: 4px 12px;
  gap: 8px;
  border: 1px solid #b19b8b;
  border-radius: 5px;
  background: #fffdf8;
  box-shadow: inset 0 1px 2px #49362e1a;
  font: 0.8125rem/1.3 var(--ui);
  color: #735d52;
  white-space: nowrap;
}

.address > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang { gap: 2px; }

.lang a {
  display: grid;
  place-items: center;
  min-width: 32px;
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
  font: 700 0.875rem/1 var(--ui);
}

.lang a.selected {
  background: #edc5d0;
  border-color: #a37a8a;
  box-shadow: inset 0 1px #fff9;
}

.lang a:hover { background: #f5d7df; }

.profile-nav {
  flex-shrink: 0;
  justify-content: flex-start;
  gap: 3px;
  padding: 6px 12px;
  background: #eee5d9;
  border-bottom: 1px solid #b6a496;
  scrollbar-width: thin;
}

.profile-nav button {
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 4px;
  border-color: transparent;
  background: transparent;
  font: 0.875rem/1.2 var(--ui);
}

.profile-nav button span { display: none; }

.profile-nav button[aria-current="page"] {
  color: #49362e;
  background: linear-gradient(#f6dce4, #e7b9c8);
  border-color: #ac8393;
  box-shadow: inset 0 1px #fffb;
  font-weight: 700;
}

.profile-nav button:hover:not([aria-current="page"]) { background: #fff7e980; }
.browser-body {
  container-type: inline-size;
  container-name: profile;
}
.browser-scroll { background: var(--cream); scroll-padding-block-end: var(--dock-clearance); }

.primary, .secondary, .text-link {
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid #a78b67;
  border-radius: 4px;
  background: linear-gradient(#f6d888, #e8bd5e);
  color: var(--ink);
  box-shadow: inset 0 1px #fff9, 0 1px #49362e16;
  font: 0.875rem/1.3 var(--ui);
  text-align: center;
}

.secondary, .text-link {
  border-color: #b29b88;
  background: linear-gradient(#fffdf7, #f0e5d5);
}

.primary:hover:not(:disabled) { background: linear-gradient(#ffe9a3, #edc76f); }
.secondary:hover:not(:disabled), .text-link:hover { background: #f7e1e8; }

.primary:active:not(:disabled), .secondary:active:not(:disabled),
.text-link:active, .browser-arrows button:active:not(:disabled),
.profile-nav button:active {
  box-shadow: inset 0 2px 3px #49362e29;
}

/* Personal profile: restrained header, then compact individual information blocks. */
.page {
  width: 100%;
  max-width: 1100px;
  min-width: 0;
  padding: 24px;
}

.hero {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  min-height: 268px;
  border: 1px solid #a9917e;
  border-radius: 4px;
  background: #fff5e1;
}

.hero-copy {
  align-items: flex-start;
  padding: 28px;
}

.hero h1 {
  max-width: 100%;
  font: 400 clamp(2.4rem, 4vw, 3.5rem)/1.05 var(--serif);
  letter-spacing: -.025em;
  text-wrap: balance;
}

.hero-description {
  margin-top: 14px;
  max-width: 42ch;
  color: #634d42;
  font: 1rem/1.55 var(--reading);
}

.hero-actions { gap: 8px; margin-top: 20px; }

.hero-image {
  min-height: 268px;
  border-left: 1px solid #a9917e;
  background: #dba0b3;
}

.hero-image > img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.hero-image figcaption {
  right: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 4px 7px;
  color: #49362e;
  background: #fff7e9e8;
  border: 1px solid #a9917e;
  font: 0.8125rem/1.3 var(--ui);
}
.collage { opacity: .94; }
.halftone { opacity: .45; }
.flower { display: none; }

.home-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
  align-items: start;
}

.panel {
  min-width: 0;
  border-color: #b59c87;
  border-radius: 4px;
  box-shadow: inset 0 1px #fff9;
  background: #fffbf2;
}

.panel h2 {
  min-height: 38px;
  padding: 10px 14px;
  border-bottom-color: #c0a394;
  background: #edc9d2;
  font: 700 0.875rem/1.3 var(--ui);
}

.obsessions-panel h2 { background: #f3dda6; }
.contact-panel h2 { background: #e8d6c4; }
.panel-body { padding: 16px 14px; font: 1rem/1.5 var(--reading); overflow-wrap: anywhere; }
.panel-body h3 {
  margin: 18px 0 8px;
  font: 700 0.875rem/1.3 var(--ui);
  text-transform: none;
  letter-spacing: 0;
}
.panel-body small { display: block; font-size: .8125rem; line-height: 1.5; }
.tags { gap: 6px; }
.tags li { font-size: .875rem; }
.obsessions { gap: 12px; }
.obsessions > div { gap: 10px; align-items: flex-start; }
.obsessions > div > span { flex-shrink: 0; width: 32px; height: 32px; }
.obsessions dt { margin-bottom: 3px; font: 700 .875rem/1.3 var(--ui); }
.obsessions dd { overflow-wrap: anywhere; }
#vote { margin-top: 14px; padding-top: 14px; border-top-color: #bca28d; }
.vote-actions { gap: 7px; margin-bottom: 8px; }
.vote-actions button { min-height: 34px; padding: 6px 9px; }

.inner-page h1, .folder-page h1, .arcade h1, .paper h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  text-wrap: balance;
}
.post h2, .favs h2, .project-summary h2, .arcade h2 {
  font: 700 1rem/1.35 var(--ui);
}
.project-summary h3, .paper h3, .folder-page > h2 {
  font: 700 .875rem/1.4 var(--ui);
}
.post time { font: .8125rem/1.4 var(--ui); }
.empty {
  padding: 18px;
  border: 1px solid #c8b6a3;
  border-radius: 4px;
  background: #fffcf5;
  font-size: 1rem;
}
.folder-page, .inner-page, .arcade { padding-top: 24px; }
.file-grid { gap: 12px; }
.file-grid .file-button { background: #fffaf0; border-color: #c5ae96; }
.attachment { aspect-ratio: 4 / 3; width: min(320px, 100%); vertical-align: top; }
.attachment img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.window[data-window="cv"] .window-body { background: #efded0; }
.doc-bar { gap: 12px; flex-wrap: wrap; font: .875rem/1.4 var(--ui); }
.arcade-list article { padding: 20px; }
.arcade-icon { display: inline-block; margin-bottom: 16px; font-size: 0; }
.arcade .empty { color: #49362e; }
.board { width: min(100%, 310px); gap: 6px; }
.board button { min-width: 0; min-height: 44px; }
.board button.lit { color: #49362e; }
.game-controls { gap: 8px; }

/* Only the dock itself intercepts pointers; the surrounding desktop stays clear. */
.bottom {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  position: fixed;
  inset: auto 0 max(8px, env(safe-area-inset-bottom));
  z-index: 3;
  padding: 0 12px;
  border: 0;
  background: none;
  pointer-events: none;
}

.bottom::before { content: none; }

#dock {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  max-width: 100%;
  min-height: 104px;
  padding: 16px 12px 9px;
  border: 1px solid #fff5e7cc;
  border-bottom-color: #b89f93;
  border-radius: 12px 12px 7px 7px;
  background: linear-gradient(#fff7e957, #fff7e98f);
  box-shadow: inset 0 1px #fff9, 0 5px 12px #49362e33;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  pointer-events: auto;
}

.dock-item {
  flex: 0 0 76px;
  min-width: 76px;
  min-height: 76px;
  gap: 0;
  padding: 0 6px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
}

.dock-item.selected { background: transparent; }
.dock-item > span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.dock-item.running::after {
  bottom: 0;
  left: calc(50% - 4px);
  width: 0;
  height: 0;
  border-radius: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid #80605d;
  background: none;
}
.dock-item.selected::after { border-bottom-color: #744966; }

.dock-item .icon {
  --size: 62px;
  width: 62px;
  height: 62px;
  margin: 0;
  box-shadow: none;
  filter: drop-shadow(0 3px 2px #49362e40);
  transform-origin: center bottom;
  transition: transform 160ms ease-out;
}
.dock-item:hover .icon, .dock-item:focus-visible .icon {
  transform: translateY(-6px) scale(1.06);
}
.dock-item:active .icon { transform: translateY(-2px) scale(.98); }

/* Original code-native icon family: one outline weight and upper-left light. */
.icon {
  --size: 48px;
  display: block;
  position: relative;
  flex-shrink: 0;
  width: var(--size);
  height: var(--size);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  font-size: 0;
  transform: none;
}
.file-button .icon { transform: none; margin-bottom: 3px; }
.icon-profile {
  border: 3px solid #fbf0df;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, #fff7e950 0deg 2deg, transparent 3deg 30deg),
    radial-gradient(circle at 35% 30%, #f2d4df, #b36f94 70%, #744966 73%);
  box-shadow: inset 0 0 0 1px #8b607a, 0 0 0 1px #8b607a;
}
.icon-profile::before {
  content: "";
  position: absolute;
  inset: 12% 41%;
  background: linear-gradient(#8a435c 0 50%, #fff5df 50%);
  clip-path: polygon(50% 0, 100% 100%, 50% 82%, 0 100%);
  transform: rotate(32deg);
}
.icon-profile::after {
  content: "";
  position: absolute;
  inset: 44%;
  border: 1px solid #885a70;
  border-radius: 50%;
  background: #fff7e9;
}
.icon-projects {
  margin-top: 10px;
  height: calc(var(--size) * .73);
  border: 1px solid #ae873f;
  border-radius: 3px 5px 5px 5px;
  background: linear-gradient(135deg, #ffdfa0, #d4a34b);
  box-shadow: inset 0 1px #fff3c3;
}
.icon-projects::before {
  content: "";
  position: absolute;
  top: -7px;
  left: -1px;
  width: 48%;
  height: 8px;
  border: 1px solid #ae873f;
  border-bottom: 0;
  border-radius: 3px 5px 0 0;
  background: #f4d58b;
}
.icon-projects::after {
  content: "";
  position: absolute;
  inset: 9% -3% -3% 3%;
  border: 1px solid #bc9249;
  border-radius: 3px;
  background: linear-gradient(135deg, #ffe8a4, #e8bd5e 75%);
  box-shadow: inset 0 1px #fff3cc;
  transform: skewX(-7deg);
}
.icon-cv {
  width: calc(var(--size) * .76);
  border: 1px solid #a89585;
  border-radius: 2px;
  background: linear-gradient(120deg, #fffefa, #f1e7d8);
  box-shadow: inset 0 1px white;
}
.icon-cv::before {
  content: "";
  position: absolute;
  inset: 15% 18% 17%;
  background: linear-gradient(#ba829b 0 20%, transparent 20% 34%, #aa9b8d 34% 37%,
    transparent 37% 49%, #aa9b8d 49% 52%, transparent 52% 64%, #aa9b8d 64% 67%,
    transparent 67% 79%, #aa9b8d 79% 82%, transparent 82%);
}
.icon-cv::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 24%;
  height: 21%;
  border-bottom: 1px solid #b4a08d;
  border-left: 1px solid #b4a08d;
  background: linear-gradient(45deg, #ded0bf 48%, #a89585 50%, #fffaf0 52%);
}
.icon-games {
  border: 1px solid #ad853e;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffe5a1, #e8bd5e);
  box-shadow: inset 0 1px #fff5cd;
}
.icon-games::before {
  content: "";
  position: absolute;
  top: 19%;
  left: 19%;
  width: 27%;
  height: 27%;
  border: 1px solid #80536d;
  border-radius: 2px;
  background: #9d6a87;
  box-shadow: calc(var(--size) * .31) 0 #c68da4,
    0 calc(var(--size) * .31) #744966;
}
.icon-games::after {
  content: "";
  position: absolute;
  right: 14%;
  bottom: 17%;
  width: 27%;
  height: 27%;
  border: 1px solid #80536d;
  border-radius: 2px;
  background: #ab758f;
  transform: rotate(-13deg) translate(1px, 1px);
  box-shadow: inset 0 1px #fff5;
}
.icon-notes {
  border: 1px solid #ab9464;
  border-radius: 3px;
  background: repeating-linear-gradient(0deg, transparent 0 8px, #c3a46755 8px 9px),
    linear-gradient(#fff0b9, #ffe49c);
  box-shadow: inset 0 8px #ad8f6155, inset 5px 0 #d6bd87;
}
.icon-notes::after {
  content: "";
  position: absolute;
  inset: 0 8% -8% 70%;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(#e9a0b6 0 10%, #ab9295 10% 16%, transparent 16% 74%,
    #eed1a0 74% 88%, #49362e 88%),
    linear-gradient(90deg, #804257 0 22%, #d489a4 22% 70%, #9c526d 70%);
  clip-path: polygon(0 0, 100% 0, 100% 74%, 50% 100%, 0 74%);
  transform: rotate(30deg);
  filter: drop-shadow(1px 1px 1px #67414766);
}
.file-button .icon-projects { height: 35px; width: 48px; margin-top: 10px; }
.dock-item .icon-projects { height: 45px; margin-top: 14px; margin-bottom: 3px; }
.dock-item .icon-cv { width: 47px; }
.file-link .icon { --size: 20px; width: 16px; height: 20px; }

/* Shared corner grip and desktop-only selection. */
.resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 2;
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: repeating-linear-gradient(135deg, transparent 0 3px, #9a8476 3px 4px, transparent 4px 7px);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  cursor: nwse-resize;
  touch-action: none;
}
.resize-handle:focus-visible { clip-path: none; outline-offset: -3px; }
.maximized .resize-handle { display: none; }
.moving-window, .moving-window * { user-select: none; }
.selection-rectangle {
  position: fixed;
  z-index: 1;
  border: 1px solid #744966;
  background: #b48bc438;
  box-shadow: inset 0 0 0 1px #fff7e944;
  pointer-events: none;
}
#shortcuts { isolation: isolate; }
#windows { z-index: 2; }

/* A resized application reflows independently of the desktop viewport. */
@container profile (max-width: 900px) and (min-width: 651px) {
  .hero-copy { padding: 24px; }
  .hero h1 { font-size: 2.75rem; }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-panel { grid-column: 1 / -1; }
}

@container profile (max-width: 650px) {
  .page { padding: 16px; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 24px; }
  .hero h1 { font-size: 2.75rem; }
  .hero-image { min-height: 210px; border-left: 0; border-top: 1px solid #a9917e; }
  .home-grid { grid-template-columns: 1fr; }
  .contact-panel { grid-row: 1; }
}

@media (max-width: 900px) and (min-width: 701px) {
  .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .hero-copy { padding: 22px; }
  .hero h1 { font-size: 2.75rem; }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-panel { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  body:not(.admin) { --dock-clearance: 106px; }
  #shortcuts { padding: 20px 12px 120px; }
  .desktop-apps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 8px;
    margin: 6vh auto 0;
    max-width: 430px;
  }
  .desktop-apps .file-button { width: 100%; min-width: 0; font-size: .875rem; }
  .file-button .icon { --size: 50px; }
  .window, .window[data-window="profile"], .window.maximized,
  .window[data-window="profile"].maximized {
    inset: max(4px, env(safe-area-inset-top)) 4px calc(var(--dock-clearance) + env(safe-area-inset-bottom));
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
  }
  .titlebar, .focused .titlebar { min-height: 42px; padding: 0 80px; }
  .window-controls { top: 4px; }
  .window-controls button, .window-controls button[data-win-action="close"] { width: 32px; height: 32px; }
  .window-controls button::before { inset: 8px; }
  .window-controls button[data-win-action="maximize"],
  .window-controls button[data-win-action="restore"] { display: none; }
  .resize-handle { display: none; }
  .browser-tools { gap: 6px; padding: 6px; }
  .browser-arrows button { width: 28px; }
  .address { padding: 4px 7px; gap: 4px; }
  .lang a { min-width: 30px; }
  .profile-nav { padding: 5px 6px; gap: 0; }
  .profile-nav button { padding: 7px 10px; min-height: 36px; }
  .page { padding: 14px; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 24px 20px; }
  .hero h1 { font-size: 2.75rem; }
  .hero-description { max-width: 100%; }
  .hero-actions { margin-top: 18px; }
  .hero-image { min-height: 205px; border-left: 0; border-top: 1px solid #a9917e; }
  .hero-image figcaption { font-size: .8125rem; }
  .home-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  .contact-panel { grid-row: 1; }
  .panel-body { padding: 16px; }
  .bottom { padding: 0 8px; }
  #dock { gap: 3px; min-height: 86px; padding: 12px 8px 8px; }
  .dock-item { flex-basis: 56px; min-width: 56px; min-height: 61px; padding: 0 4px 8px; }
  .dock-item .icon { --size: 48px; width: 48px; height: 48px; }
  .dock-item .icon-cv { width: 36px; }
  .dock-item .icon-projects { height: 35px; margin-top: 10px; margin-bottom: 3px; }
  .window-body:not(.browser-body), .browser-scroll {
    padding-bottom: 20px;
    scroll-padding-block-end: 20px;
  }
  .document-wrap { padding: 14px; }
  .doc-bar .primary { width: 100%; }
  .game-controls { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .dock-item .icon { transition: none; }
}
