:root {
  --black: #000;
  --white: #fff;
  --gray: #888;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Courier Prime", "Monaco", "Courier New", monospace;
  color: #000;
  min-height: 100vh;
  padding-top: 22px;
  background-color: #d9d9d9;
  background-image:
    linear-gradient(45deg, #bfbfbf 25%, transparent 25%),
    linear-gradient(-45deg, #bfbfbf 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #bfbfbf 75%),
    linear-gradient(-45deg, transparent 75%, #bfbfbf 75%);
  background-size: 4px 4px;
  background-position: 0 0, 0 2px, 2px -2px, -2px 0px;
}

/* ---------- language toggle ---------- */
html:not(.lang-en) [data-lang="en"] { display: none; }
html.lang-en [data-lang="es"] { display: none; }

.lang-switch {
  display: inline-flex;
  border: 1.2px solid #000;
  margin-left: 10px;
}
.lang-btn {
  font-family: "Silkscreen", monospace;
  font-size: 9px;
  border: none;
  background: #fff;
  padding: 2px 6px;
  cursor: pointer;
  color: #000;
}
.lang-btn + .lang-btn { border-left: 1.2px solid #000; }
.lang-btn.active { background: #000; color: #fff; }

/* ---------- menu bar ---------- */
.menubar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 22px;
  background: #fff;
  border-bottom: 1.5px solid #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-family: "Silkscreen", monospace;
  font-size: 11px;
  z-index: 50;
}
.menu-left { display: flex; align-items: center; gap: 16px; }
.apple-logo svg { width: 13px; height: 13px; }
.apple-logo svg path { fill: #000; }
.menu-right { color: #000; display: flex; align-items: center; }

/* ---------- desktop icons ---------- */
.desktop-icon {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: "Silkscreen", monospace;
  font-size: 9px;
  text-align: center;
  width: 64px;
  z-index: 5;
}
.desktop-icon svg { width: 36px; height: auto; filter: drop-shadow(0 1px 0 rgba(0,0,0,0.2)); }
.desktop-icon span:last-child {
  background: #d9d9d9;
  padding: 1px 3px;
}
.hd-icon { top: 34px; right: 24px; }
.trash-icon { bottom: 20px; right: 24px; }

/* ---------- desktop main / window layout ---------- */
.desktop-main {
  max-width: 680px;
  margin: 2.5rem auto 4rem;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

/* ---------- window chrome ---------- */
.mac-window {
  background: #fff;
  border: 1.5px solid #000;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.55);
  transform: rotate(var(--rot, 0deg));
  position: relative;
}

.title-bar {
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
  border-bottom: 1.5px solid #000;
  background-image: repeating-linear-gradient(
    to bottom, #fff 0, #fff 1px, #ccc 1px, #ccc 2px
  );
}

.close-box {
  width: 11px; height: 11px;
  border: 1.2px solid #000;
  background: #fff;
  flex-shrink: 0;
}

.title-text {
  font-family: "Silkscreen", monospace;
  font-size: 11px;
  background: #fff;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zoom-box {
  width: 13px; height: 11px;
  border: 1.2px solid #000;
  background: #fff;
  flex-shrink: 0;
  position: relative;
}
.zoom-box span {
  position: absolute;
  top: 2px; left: 2px;
  width: 6px; height: 5px;
  border: 1px solid #000;
}

.status-line {
  font-family: "Silkscreen", monospace;
  font-size: 9px;
  padding: 4px 8px;
  border-bottom: 1px solid #000;
  background: #fff;
}

.window-body {
  display: flex;
  align-items: stretch;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 0.9rem 1rem;
}

.doc-content p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0 0 1rem;
}
.doc-content p:last-child { margin-bottom: 0; }

/* ---------- finder list view ---------- */
.list-header {
  display: flex;
  gap: 0.6rem;
  font-family: "Silkscreen", monospace;
  font-size: 9px;
  border-bottom: 1px solid #000;
  padding-bottom: 5px;
  margin-bottom: 3px;
}
.list-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 5px 2px;
  text-decoration: none;
  color: #000;
  font-size: 0.82rem;
  border-bottom: 1px dotted #999;
}
.list-row:hover .col-name { background: #000; color: #fff; }
.list-row:hover svg path,
.list-row:hover svg line { stroke: #fff; }

.col-name { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; min-width: 0; }
.col-size { width: 34px; font-size: 0.78rem; color: #333; flex-shrink: 0; }
.col-kind { width: 130px; font-size: 0.78rem; color: #333; flex-shrink: 0; }
.col-date { width: 60px; font-size: 0.78rem; color: #333; flex-shrink: 0; text-align: right; }

.doc-icon { width: 15px; height: 18px; flex-shrink: 0; }

.finder-hint {
  font-size: 0.72rem;
  color: #555;
  font-style: italic;
  margin: 0.8rem 0 0;
}

/* ---------- scrollbars (decorative, always-on like classic Mac) ---------- */
.v-scroll {
  width: 16px;
  flex-shrink: 0;
  border-left: 1.5px solid #000;
  display: flex;
  flex-direction: column;
}
.v-scroll .arrow {
  height: 16px;
  border-bottom: 1px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  background: #fff;
}
.v-scroll .arrow:last-child { border-bottom: none; border-top: 1px solid #000; }
.v-scroll .track {
  flex: 1;
  background-image:
    linear-gradient(45deg, #bfbfbf 25%, transparent 25%),
    linear-gradient(-45deg, #bfbfbf 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #bfbfbf 75%),
    linear-gradient(-45deg, transparent 75%, #bfbfbf 75%);
  background-size: 4px 4px;
  background-color: #fff;
}

.h-scroll-row {
  display: flex;
  border-top: 1.5px solid #000;
}
.h-scroll {
  flex: 1;
  display: flex;
}
.h-scroll .arrow {
  width: 16px;
  border-right: 1px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  background: #fff;
  flex-shrink: 0;
}
.h-scroll .arrow:last-child { border-right: none; border-left: 1px solid #000; }
.h-scroll .track {
  flex: 1;
  background-image:
    linear-gradient(45deg, #bfbfbf 25%, transparent 25%),
    linear-gradient(-45deg, #bfbfbf 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #bfbfbf 75%),
    linear-gradient(-45deg, transparent 75%, #bfbfbf 75%);
  background-size: 4px 4px;
  background-color: #fff;
}
.grow-box {
  width: 16px; height: 16px;
  flex-shrink: 0;
  border-left: 1.5px solid #000;
  background-image: repeating-linear-gradient(
    -45deg, #000 0, #000 1px, transparent 1px, transparent 3px
  );
}

/* ---------- contact list ---------- */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.85rem;
}
.contact-list li {
  display: flex;
  gap: 0.6rem;
  padding: 4px 0;
  border-bottom: 1px dotted #999;
}
.contact-list li:last-child { border-bottom: none; }
.contact-list .label {
  font-family: "Silkscreen", monospace;
  font-size: 8px;
  min-width: 60px;
  align-self: center;
  color: #333;
}
.contact-list a { color: #000; }
.ps {
  font-size: 0.78rem;
  font-style: italic;
  color: #333;
  margin: 0;
}

.footer-note {
  text-align: center;
  font-family: "Silkscreen", monospace;
  font-size: 8px;
  color: #444;
  letter-spacing: 0.03em;
}

a:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

@media (max-width: 560px) {
  .desktop-icon { display: none; }
  .mac-window { transform: none; }
  .col-kind { display: none; }
  .col-date { display: none; }
  .desktop-main { margin-top: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
