/* Portfolio de Marc: la web es un escritorio Hyprland.
   Paleta «LanternGreen» (la del escritorio CachyOS). El verde neón solo marca lo activo:
   la ventana con el foco, el espacio de trabajo actual y el prompt del terminal. */

@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap; src: url("../fonts/jetbrains-mono-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2"); }

:root {
  --wall: #050f08;        /* fondo de escritorio */
  --win: #0a1a10;         /* ventana */
  --win-2: #0d2216;       /* zona de dibujo dentro de una ventana */
  --border: #1d3826;      /* borde de ventana inactiva */
  --accent: #1aff6e;      /* borde activo, prompt, espacio actual */
  --text: #e6ffed;
  --muted: #8fb39b;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, "Segoe UI", Roboto, sans-serif;
  --gap: 12px;
  --round: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 56px; }
body {
  margin: 0; padding-top: 44px;
  background: var(--wall);
  background-image: radial-gradient(120vmax 60vmax at 80% -20%, #0b2a17 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text); font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 6px; z-index: 100; background: var(--accent); color: var(--wall); padding: 6px 12px; border-radius: 6px; font: 600 14px var(--mono); }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Barra ---- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px;
  background: rgba(5, 15, 8, 0.88); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font: 13px var(--mono);
}
.workspaces { display: flex; gap: 4px; }
.workspaces a { display: flex; align-items: center; gap: 7px; padding: 4px 8px 4px 4px; border-radius: 6px; text-decoration: none; color: var(--muted); }
.workspaces a:hover { color: var(--text); }
.num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--border); font-weight: 700; }
.workspaces a[aria-current="true"] { color: var(--text); }
.workspaces a[aria-current="true"] .num { background: var(--accent); border-color: var(--accent); color: var(--wall); }
.bar-right { display: flex; align-items: center; gap: 14px; }
.lang { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.lang button { font: 13px var(--mono); color: var(--muted); background: none; border: 0; padding: 3px 9px; cursor: pointer; }
.lang button + button { border-left: 1px solid var(--border); }
.lang button[aria-pressed="true"] { color: var(--wall); background: var(--accent); }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- Espacios de trabajo y ventanas en mosaico ---- */
main { max-width: 1240px; margin: 0 auto; padding: 0 var(--gap); }
.workspace { display: grid; gap: var(--gap); padding: var(--gap) 0 calc(var(--gap) * 4); }
.window {
  background: var(--win); border: 2px solid var(--border); border-radius: var(--round);
  overflow: hidden; display: flex; flex-direction: column; min-width: 0;
}
.window.active, .window:focus-within { border-color: var(--accent); box-shadow: 0 0 22px rgba(26, 255, 110, 0.18); }
.title {
  display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px;
  font: 12.5px var(--mono); color: var(--muted); border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.title .app { opacity: 0.6; }
.body { padding: 20px 22px 22px; }
.body h3 { font: 600 1.45rem/1.2 var(--sans); margin-bottom: 10px; letter-spacing: -0.01em; }
.body p { color: var(--muted); max-width: 64ch; }
.body p + p { margin-top: 12px; }

/* 1 · inicio: terminal grande a la izquierda, foto y enlaces a la derecha */
.ws-home { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); grid-template-rows: auto 1fr; }
.win-term { grid-row: 1 / 3; }
.term { padding: 22px 24px 26px; font: 15px/1.7 var(--mono); }
.prompt { color: var(--accent); }
.term .out { color: var(--text); }
.term .out + .cmd { margin-top: 14px; }
.name { font: 700 clamp(2rem, 4.6vw, 3.6rem)/1.05 var(--mono); letter-spacing: -0.03em; margin: 6px 0 4px; }
.about { color: var(--muted) !important; max-width: 58ch; }
.cursor { display: inline-block; width: 0.6em; height: 1.15em; vertical-align: text-bottom; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.win-photo img { width: 100%; max-width: 260px; margin: 18px auto; border-radius: 6px; aspect-ratio: 1; object-fit: cover; }
.links { list-style: none; margin: 0; padding: 16px 18px 18px; font: 14px/1.5 var(--mono); display: grid; gap: 8px; }
.links a { text-decoration: none; overflow-wrap: anywhere; }
.links a::before { content: "❯ "; color: var(--accent); }
.links a:hover { text-decoration: underline; }

/* 2 · proyectos: ARTHUR ocupa la columna izquierda; servidor y linux, la derecha; la lista, abajo */
.ws-projects { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.win-arthur { grid-row: span 2; }
.win-todo { grid-column: 1 / -1; }
.art { background: var(--win-2); border-bottom: 1px solid var(--border); }
.art-orb { display: grid; place-items: center; min-height: 260px; flex: 1; }
.orb {
  width: 132px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #c8ffdb 0%, var(--accent) 30%, #0c6a33 66%, #03190c 100%);
  box-shadow: 0 0 60px rgba(26, 255, 110, 0.35), inset -14px -18px 34px rgba(0, 0, 0, 0.45);
}
.art-shell { margin: 0; padding: 18px 20px; font: 13px/1.75 var(--mono); color: var(--text); overflow-x: auto; }
.art-shell .ok { color: var(--accent); display: inline-block; width: 7.5ch; }
.art-tiles { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: 46px 46px; gap: 6px; padding: 16px; }
.art-tiles i { border: 1.5px solid var(--border); border-radius: 5px; }
.art-tiles i:first-child { grid-row: 1 / 3; border-color: var(--accent); }
.art-tiles i:nth-child(4) { grid-column: 2 / 4; }
.tags { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px; font: 12.5px var(--mono); }
.tags li { border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; color: var(--muted); }
.note { margin-top: 14px !important; font-size: 0.92rem; }
.todo { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 10px; color: var(--muted); }
.todo li { padding-left: 2.6em; text-indent: -2.6em; }
.todo li::before { content: "[ ] "; font-family: var(--mono); color: var(--accent); white-space: pre; }

/* 3 · habilidades y servicio */
.ws-skills { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: stretch; }
.config { margin: 0; padding: 20px 22px 24px; font: 14.5px/1.6 var(--mono); }
.config dt { color: var(--accent); }
.config dd { margin: 0 0 16px; color: var(--text); }
.config dd:last-child { margin-bottom: 0; }
.price { margin-top: 18px !important; color: var(--muted); }
.price strong { font: 700 2.2rem var(--mono); color: var(--text); margin-left: 4px; }
.button {
  display: inline-block; margin-top: 16px; padding: 9px 16px; border-radius: 6px;
  background: var(--accent); color: var(--wall); font: 700 14px var(--mono); text-decoration: none;
}
.button:hover { background: #6dffa3; }

/* 4 · contacto */
.ws-contact { max-width: 760px; }
.win-mail h2 { font: 600 2rem/1.15 var(--sans); margin-bottom: 10px; }
.mail-to { margin-top: 18px !important; font: 15px var(--mono); color: var(--text) !important; overflow-wrap: anywhere; }
.mail-to a { color: var(--accent); }
.other { display: flex; gap: 18px; margin-top: 14px !important; font: 14px var(--mono); }
.other a:hover, .mail-to a:hover { text-decoration: none; }

.footer { text-align: center; color: var(--muted); font: 12.5px/1.7 var(--mono); padding: 8px 16px 40px; }

/* El único momento animado: al cargar, las ventanas del inicio se abren como en Hyprland */
.js .opening { animation: open 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
.js .win-photo { animation-delay: 0.08s; }
.js .win-links { animation-delay: 0.16s; }
@keyframes open { from { opacity: 0; transform: scale(0.93); } }
.typing .cmd, .typing .out { visibility: hidden; }
.typing .shown { visibility: visible; }

/* Móvil y pantallas estrechas: las ventanas se apilan */
@media (max-width: 860px) {
  .ws-home, .ws-projects, .ws-skills { grid-template-columns: 1fr; min-height: 0; }
  .win-term, .win-arthur { grid-row: auto; }
  .ws-home { grid-template-rows: none; }
  .win-photo img { max-width: 200px; }
  .art-orb { min-height: 200px; }
}
@media (max-width: 560px) {
  .ws-name { display: none; }
  .clock { display: none; }
  .workspaces a { padding: 4px; }
  .term { padding: 18px 16px 20px; font-size: 14px; }
  .body { padding: 18px 16px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .opening { animation: none; }
  .cursor { animation: none; }
}
