/* ------------------------------------------------------------------
   Espiral OS — o site como uma área de trabalho.
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter/Inter-VF.woff2") format("woff2-variations"),
       url("../assets/fonts/inter/Inter-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f3f1f2;
  --ink: #111111;
  --ink-2: #4b4b4f;
  --ink-3: #8a8a90;
  --line: #e3e0e2;
  --glass: rgba(255, 255, 255, 0.86);
  --window: #ffffff;
  --accent: #3b2bff;        /* azul-violeta do papel de parede */
  --accent-2: #b24cff;
  --red: #ff5f57;
  --yellow: #febc2e;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 24px 60px -24px rgba(17, 17, 17, 0.35), 0 0 0 1px rgba(17, 17, 17, 0.06);
  --ease: cubic-bezier(0.2, 0.9, 0.2, 1);
  --topbar-h: 56px;
  --dock-h: 72px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  font-feature-settings: "cv11" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
sup { font-size: 0.6em; vertical-align: 0.5em; }

/* Boot -------------------------------------------------------------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  color: #fff;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 26px;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot-logo { font-weight: 800; font-size: 64px; letter-spacing: -0.06em; line-height: 1; }
.boot-glyph {
  display: inline-block;
  animation: boot-jitter 0.14s steps(2) infinite;
  text-shadow: 2px 0 0 rgba(255, 255, 255, 0.35), -2px 0 0 rgba(255, 255, 255, 0.2);
}
@keyframes boot-jitter {
  0% { transform: translate(0, 0) skewX(0deg); clip-path: inset(0 0 0 0); }
  50% { transform: translate(-2px, 1px) skewX(-6deg); clip-path: inset(10% 0 30% 0); }
  100% { transform: translate(2px, -1px) skewX(4deg); clip-path: inset(40% 0 5% 0); }
}
.boot-bar { width: 140px; height: 2px; background: #2a2a2a; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: #fff; transition: width 0.25s linear; }
.boot-words {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.boot-word { color: #9a9a9a; min-width: 12ch; }

/* Barra superior ---------------------------------------------------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar-right { display: flex; gap: 6px; align-items: center; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 0 0 1px rgba(17, 17, 17, 0.05);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.pill-brand { font-weight: 700; letter-spacing: 0.02em; }
.pill-clock .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.pill-cta { background: var(--ink); color: #fff; font-weight: 600; }
.pill-cta:hover { background: #2a2a2a; }

.switch {
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: #d9d6d8;
  position: relative;
  transition: background 0.25s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s var(--ease);
}
.pill-toggle[aria-pressed="true"] .switch { background: var(--accent); }
.pill-toggle[aria-pressed="true"] .switch::after { transform: translateX(12px); }

/* Área de trabalho --------------------------------------------------- */

.desktop {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.icons { position: absolute; inset: 0; }

.icon {
  position: absolute;
  width: 112px;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-radius: 10px;
  cursor: grab;
  touch-action: none;
  will-change: transform;
}
.icon:active { cursor: grabbing; }
.icon.is-selected .icon-label { background: var(--accent); color: #fff; }
.icon-art {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px -14px rgba(17, 17, 17, 0.5);
  transition: transform 0.3s var(--ease);
}
.icon:hover .icon-art { transform: translateY(-2px) scale(1.04); }
.icon-art svg, .icon-art img, .icon-art video { width: 100%; height: 100%; display: block; object-fit: cover; }
.icon-art.is-folder { box-shadow: none; }
.icon-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 2px 6px;
  border-radius: 5px;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Janelas ----------------------------------------------------------- */

.windows { position: absolute; inset: 0; pointer-events: none; }

.win {
  position: absolute;
  pointer-events: auto;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - var(--topbar-h) - var(--dock-h) - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--window);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-origin: 50% 60%;
  animation: win-in 0.45s var(--ease);
}
.win.is-closing { animation: win-out 0.25s ease forwards; }
.win.is-min { display: none; }
@keyframes win-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes win-out { to { opacity: 0; transform: translateY(8px) scale(0.97); } }

.win-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  cursor: grab;
  touch-action: none;
  background: #fafafa;
}
.win-bar:active { cursor: grabbing; }
.win-dots { display: flex; gap: 7px; }
.win-dots button {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--red);
  position: relative;
}
.win-dots button.is-min-btn { background: var(--yellow); }
.win-dots button::after {
  content: "";
  position: absolute;
  inset: -6px;
}
/* Ao passar o mouse pela barra, os botões mostram o símbolo (× e –),
   como no Mac. */
.win-dots button::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.15s;
  background-color: rgba(0, 0, 0, 0.55);
  -webkit-mask: var(--glyph) center / 8px 8px no-repeat;
  mask: var(--glyph) center / 8px 8px no-repeat;
}
.win-dots:hover button::before { opacity: 1; }
.win-dots .is-close-btn { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 2l6 6M8 2l-6 6' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.win-dots .is-min-btn { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 5h6' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.win-title {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50vw;
}
.win-body {
  overflow: auto;
  overscroll-behavior: contain;
  user-select: text;
}
.win-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  font-size: 12.5px;
}
.win-foot:empty { display: none; }
.win-foot a { color: var(--accent); text-decoration: none; font-weight: 500; }

/* Janela "cartão" (destaque) */
.card { padding: 16px; display: grid; gap: 18px; }
.card-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.card-avatar {
  width: 84px; height: 84px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.card-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.card-head p { color: var(--ink-2); font-size: 12.5px; margin-top: 3px; }
.card-meta { text-align: right; font-size: 11.5px; color: var(--ink-2); }
.card-meta b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

.acc { border-top: 1px solid var(--line); }
.acc summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after {
  content: "";
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--ink-2);
  border-bottom: 1.5px solid var(--ink-2);
  transform: rotate(45deg);
  margin-left: 2px;
  transition: transform 0.2s;
}
.acc[open] summary::after { transform: rotate(-135deg) translate(-1px, -1px); }
.acc-body { padding: 0 0 14px; color: var(--ink-2); font-size: 12.5px; max-width: 62ch; }
.acc-body p + p { margin-top: 8px; }
.acc-body ul { display: grid; gap: 6px; }
.acc-body li { padding-left: 14px; position: relative; }
.acc-body li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.card-banner {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  background: var(--bg);
}
.card-banner svg, .card-banner img { width: 100%; height: 100%; display: block; object-fit: cover; }

/* Janela "Finder" */
.finder { display: grid; grid-template-columns: 200px 1fr; min-height: 420px; }
.finder-side {
  background: #f6f5f6;
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  display: grid;
  align-content: start;
  gap: 2px;
}
.finder-side h4 { font-size: 10.5px; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 600; margin: 10px 8px 6px; }
.finder-side button, .finder-side a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  text-decoration: none;
  text-align: left;
}
.finder-side button:hover, .finder-side a:hover { background: #ecebed; }
.finder-side .is-active { background: var(--accent); color: #fff; }
.finder-side .is-active:hover { background: var(--accent); }
.finder-side svg { width: 14px; height: 14px; flex: none; }
.finder-main { padding: 16px; }
.finder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; }
.tile {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 8px 4px;
  border-radius: 10px;
}
.tile:hover { background: #f3f1f2; }
.tile-art { width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.tile-art svg, .tile-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.tile span { font-size: 11.5px; font-weight: 500; }
.tile small { color: var(--ink-3); font-size: 10.5px; }

/* Janela de texto */
.txt { padding: 18px 20px; font-size: 13px; line-height: 1.6; color: var(--ink); max-width: 60ch; }
.txt p + p { margin-top: 12px; }
.txt h3 { font-size: 13px; font-weight: 700; margin: 18px 0 6px; }

/* Janela de mídia (projeto) */
.media { display: grid; }
.media-art { aspect-ratio: 16 / 10; background: var(--bg); }
.media-art svg, .media-art img, .media-art video { width: 100%; height: 100%; display: block; object-fit: cover; }
.media-info { padding: 16px; display: grid; gap: 8px; }
.media-info h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.media-info p { color: var(--ink-2); max-width: 60ch; }
.media-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.media-tags span { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #f0eef0; color: var(--ink-2); }

/* Pessoas */
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; }
.person { display: grid; gap: 10px; }
.person-art { aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; }
.person-art svg, .person-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.person h3 { font-size: 15px; font-weight: 700; }
.person p { color: var(--ink-2); }

/* Serviços */
.services { display: grid; gap: 10px; padding: 16px; }
.service {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.service.is-main { background: var(--ink); color: #fff; border-color: var(--ink); }
.service.is-main p { color: #cfcfd4; }
.service-icon { width: 44px; height: 44px; border-radius: 9px; background: var(--bg); display: grid; place-items: center; }
.service.is-main .service-icon { background: #2b2b2f; }
.service h3 { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.service p { color: var(--ink-2); max-width: 56ch; }

/* Contato */
.contact { padding: 20px 16px; display: grid; gap: 14px; }
.contact h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.contact p { color: var(--ink-2); max-width: 50ch; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.btn-ghost { background: #f0eef0; color: var(--ink); }

/* Dock -------------------------------------------------------------- */

.dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 400;
  width: min(400px, calc(100vw - 32px));
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  height: 50px;
  padding: 0 14px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}
.dock-glyph { font-weight: 800; font-size: 22px; letter-spacing: -0.06em; }
.dock-label { font-weight: 700; letter-spacing: 0.08em; font-size: 13px; text-align: center; height: 50px; }
.dock-burger { width: 28px; height: 28px; display: grid; gap: 4px; align-content: center; justify-items: center; }
.dock-burger i { width: 18px; height: 2px; background: #fff; border-radius: 2px; transition: transform 0.25s, opacity 0.2s; }
.dock.is-open .dock-burger i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.dock.is-open .dock-burger i:nth-child(2) { opacity: 0; }
.dock.is-open .dock-burger i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.dock-menu {
  position: absolute;
  left: 0; right: 0;
  bottom: 50px;
  background: var(--ink);
  border-radius: 12px 12px 0 0;
  padding: 6px 0 0;
  overflow: hidden;
  animation: win-in 0.3s var(--ease);
}
.dock-menu li + li { border-top: 1px solid #2a2a2e; }
.dock-menu button, .dock-menu a {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 12.5px;
  text-transform: uppercase;
  text-decoration: none;
  text-align: left;
}
.dock-menu button:hover, .dock-menu a:hover { background: #222226; }
.dock-menu a svg { margin-left: auto; }
.mi { width: 40px; height: 40px; border-radius: 8px; flex: none; background: #333; }
.mi-sobre { background: linear-gradient(135deg, #3b2bff, #b24cff); }
.mi-servicos { background: linear-gradient(135deg, #111, #444); box-shadow: inset 0 0 0 2px #fff2; }
.mi-trabalhos { background: linear-gradient(135deg, #ff9a3c, #ff4d6d); }
.mi-quem { background: linear-gradient(135deg, #1fd1a5, #0b7a5e); }
.mi-contato { background: linear-gradient(135deg, #fff, #ddd); }
.mi-insta { background: linear-gradient(135deg, #f9ce34, #ee2a7b 50%, #6228d7); }

/* Notificação ------------------------------------------------------- */

.toast {
  position: fixed;
  right: 14px;
  bottom: 86px;
  z-index: 350;
  width: min(340px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  animation: toast-in 0.5s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } }
.toast-avatar {
  width: 40px; height: 40px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1fd1a5, #0b7a5e);
  color: #fff;
  font-weight: 800;
}
.toast-body { display: grid; gap: 3px; font-size: 12px; }
.toast-body small { color: var(--ink-3); font-size: 10.5px; }
.toast-body strong { font-size: 12.5px; }
.toast-body p { color: var(--ink-2); }
.toast-body a { color: var(--accent); text-decoration: none; font-weight: 600; margin-top: 2px; }
.toast-close { font-size: 18px; line-height: 1; color: var(--ink-3); align-self: start; }

/* Protetor de tela -------------------------------------------------- */

.screensaver {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: #000;
  color: #fff;
  cursor: none;
}
.ss-logo {
  position: absolute;
  left: 0; top: 0;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 0.02em;
  padding: 10px 14px;
  border: 2px solid #fff;
  border-radius: 8px;
  will-change: transform;
}

/* Celular ------------------------------------------------------------ */

@media (max-width: 720px) {
  .pill-toggle span, .pill-clock { display: none; }
  .pill-toggle { padding: 0 10px; }
  .icon { width: 86px; }
  .icon-art { width: 56px; height: 56px; }
  .win {
    width: calc(100vw - 16px);
    left: 8px !important;
    top: calc(var(--topbar-h) + 4px) !important;
    max-height: calc(100vh - var(--topbar-h) - var(--dock-h) - 12px);
  }
  .finder { grid-template-columns: 1fr; }
  .finder-side { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .finder-side h4 { display: none; }
  .finder-side button, .finder-side a { width: auto; }
  .people { grid-template-columns: 1fr; }
  .card-head { grid-template-columns: auto 1fr; }
  .card-meta { grid-column: 1 / -1; text-align: left; }
  .toast { bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-glyph { animation: none; }
  .win, .dock-menu, .toast { animation: none; }
  .icon-art, .switch::after { transition: none; }
}
