/* ==========================================================================
   Gabriel Almeida — portfolio
   A dark instrument panel: hairline structure, monospace telemetry, and one
   warm object (the record) that carries all the movement on the page.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/geist-mono-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --void: #161f2c;
  --panel: #1c2634;
  --panel-hi: #222d3d;
  --line: #2c384c;
  --line-hi: #3f4c66;
  --text: #eaeef4;
  --dim: #acb6c6;
  --muted: #8590a1;

  /* One accent family. Deep blue carries every interactive surface; the
     brightest step is reserved for live state, so "the machine is telling you
     something right now" never looks like an ordinary link. */
  --blue-deep: #2c5aa8;
  --blue: #4a7fd6;
  --blue-bright: #6ea6f0;
  --blue-wash: rgba(74, 127, 214, 0.09);

  --display: "Geist", ui-sans-serif, system-ui, sans-serif;
  --body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1440px;
  --radius: 10px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* A field of wide concentric arcs thrown off the top-right corner, faded out
   before it reaches the content. Spaced far apart on purpose: tight rings at
   this radius read as diagonal stripes rather than as a record. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-radial-gradient(
    circle at 86% -6%,
    rgba(200, 215, 235, 0.11) 0 1px,
    transparent 1px 68px
  );
  -webkit-mask-image: radial-gradient(circle at 86% -6%, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 72%);
  mask-image: radial-gradient(circle at 86% -6%, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 72%);
}

/* Grain, generated inline: dark flat fields band badly and read as plastic.
   Desaturated fractal noise at very low opacity gives the page a surface. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)'/%3E%3C/svg%3E");
}

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }

a { color: inherit; }

img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.7rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line-hi);
  font-family: var(--mono);
  font-size: 0.72rem;
  z-index: 200;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* --- shared type ---------------------------------------------------------- */

/* Utility labels. Geist Mono at a larger size with much tighter tracking than
   a classic "telemetry" label: wide-tracked 9px type looks the part but is
   genuinely hard to read, and these are the labels that name every section. */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* --- masthead ------------------------------------------------------------- */

.masthead {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 6rem) clamp(1.15rem, 4vw, 3.5rem) clamp(2.5rem, 6vh, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.name {
  font-family: var(--display);
  font-size: clamp(3.1rem, 8.5vw, 5.6rem);
  font-weight: 620;
  /* The tension of the page: display type set very tight, utility type set
     very loose. Everything else stays neutral between those two poles. */
  letter-spacing: -0.05em;
  line-height: 0.86;
  margin: 1.15rem 0 0;
}

.lede {
  margin-top: 1.6rem;
  max-width: 44ch;
  color: var(--dim);
  font-size: 1.02rem;
  line-height: 1.7;
}

.vitals {
  margin-top: 1.9rem;
  display: grid;
  gap: 0.7rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.vitals__row {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
}
.vitals dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.vitals dd { font-size: 0.88rem; color: var(--dim); }

.actions {
  margin-top: 1.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.62rem 1.1rem;
  border: 1px solid var(--line-hi);
  border-radius: 5px;
  font-size: 0.83rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.btn:hover {
  border-color: var(--blue);
  background: var(--blue-wash);
  transform: translateY(-1px);
}
.btn--solid {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  color: #eef4ff;
}
.btn--solid:hover { background: var(--blue); border-color: var(--blue); }


/* --- the record ----------------------------------------------------------- */

.masthead__deck { display: flex; justify-content: center; }

.turntable {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.9rem;
  width: 100%;
}

.platter {
  position: relative;
  width: min(380px, 74vw);
  aspect-ratio: 1;
}

/* Platter halo — gives the disc a surface and lifts its silhouette off the
   page without drawing a literal turntable. */
.platter::before {
  content: "";
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(122, 152, 205, 0.13) 0%,
    rgba(122, 152, 205, 0.05) 52%,
    transparent 71%
  );
  z-index: 0;
}

.record {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 33% 27%, #232b3a 0%, #11161f 24%, #080c13 56%, #04060a 100%);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

/* Grooves are drawn, not spun: a pressed record is rotationally symmetric, so
   only the label needs to move for the eye to read rotation. */
.record__grooves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at 50% 50%,
    rgba(0, 0, 0, 0.55) 0 1.4px,
    rgba(255, 255, 255, 0.03) 1.4px 3.3px
  );
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 0 19%, #000 19.6% 98%, transparent 99%);
  mask-image: radial-gradient(circle at 50% 50%, transparent 0 19%, #000 19.6% 98%, transparent 99%);
  opacity: 0.85;
}

/* A fixed light source: the sheen must not rotate with the label. */
.record__sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 200deg,
    transparent 0 8%,
    rgba(255, 255, 255, 0.06) 16%,
    transparent 27%,
    transparent 58%,
    rgba(255, 255, 255, 0.035) 68%,
    transparent 79%
  );
  pointer-events: none;
}

.record__label {
  position: absolute;
  /* Centred with offsets rather than translate(-50%, -50%): the spin keyframes
     set `transform`, which would otherwise replace the centring and swing the
     label around its own corner. */
  top: 31.5%;
  left: 31.5%;
  width: 37%;
  aspect-ratio: 1;
  transform-origin: 50% 50%;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 36% 30%, #24457e 0%, #1b3462 45%, #12244a 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.record__art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.record__mark {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: #cfe0f8;
}
.record__art:not([hidden]) ~ .record__mark { display: none; }

.record__spindle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3.2%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--void);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  z-index: 2;
}

/* The live ring: a short arc orbiting the rim, on only while audio is on. */
.live-ring {
  position: absolute;
  inset: -9px;
  width: calc(100% + 18px);
  height: calc(100% + 18px);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.live-ring circle {
  fill: none;
  stroke: var(--blue-bright);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 38 572;
  transform-origin: 50% 50%;
}


.platter[data-playing="true"] .record__label { animation: spin 3.4s linear infinite; }
.platter[data-playing="true"] .live-ring { opacity: 1; }
.platter[data-playing="true"] .live-ring circle { animation: spin 5.5s linear infinite; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* --- readout -------------------------------------------------------------- */

.readout { text-align: center; display: grid; gap: 0.4rem; justify-items: center; }

.readout__state {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.readout__state--live { color: var(--blue-bright); }
.readout__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}
.readout__state--live .readout__dot {
  background: var(--blue-bright);
  box-shadow: 0 0 6px var(--blue-bright);
}

.readout__title {
  font-family: var(--display);
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.readout__title a { text-decoration: none; }
.readout__title a:hover { color: var(--blue-bright); }

.readout__artist { font-size: 0.83rem; color: var(--dim); }
.readout__hint { font-size: 0.78rem; color: var(--muted); }

.meter {
  margin-top: 0.5rem;
  width: 190px;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.meter__fill {
  display: block;
  height: 100%;
  background: var(--blue-bright);
  transition: width 1s linear;
}
.readout__time {
  width: 190px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* --- grid ----------------------------------------------------------------- */

/* The grid sizes itself from the cards, not from a fixed column count: adding
   a panel in content.Panels() is the whole change, at any viewport. Cards span
   one track by default; .card--wide takes the full row for content that needs
   the width (repositories, the stack). */
.grid {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 clamp(1.15rem, 4vw, 3.5rem) clamp(3rem, 8vh, 5rem);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  grid-auto-flow: row dense;
  gap: 14px;
}

.card--wide { grid-column: 1 / -1; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.45rem;
  min-height: 182px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}

button.card { cursor: pointer; width: 100%; }
button.card:hover {
  border-color: rgba(74, 127, 214, 0.55);
  background: var(--panel-hi);
  transform: translateY(-2px);
}

/* Corner brackets — an instrument reticle, drawn only on the card you are
   pointing at, so the resting grid stays completely quiet. */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border-color: var(--blue);
  opacity: 0;
  transition: opacity 0.25s;
}
.card::before { top: 7px; left: 7px; border-top: 1px solid; border-left: 1px solid; }
.card::after { bottom: 7px; right: 7px; border-bottom: 1px solid; border-right: 1px solid; }
button.card:hover::before,
button.card:hover::after,
button.card:focus-visible::before,
button.card:focus-visible::after { opacity: 1; }

.card__eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.card__title {
  font-family: var(--display);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.28;
}
.card__summary { font-size: 0.85rem; color: var(--dim); line-height: 1.65; }
.card__empty { font-size: 0.85rem; color: var(--muted); line-height: 1.65; }
.card__empty a { color: var(--dim); }

.card__cue {
  margin-top: auto;
  padding-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  opacity: 0.65;
  transition: opacity 0.25s;
}
.card__cue::before { content: "→ "; }
button.card:hover .card__cue { opacity: 1; }


/* --- repositories --------------------------------------------------------- */

/* Repositories flow into columns on a wide card rather than running as one
   long list down the left edge. */
.repos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 1.5rem 2rem;
  margin-top: 0.5rem;
}
/* No rules between entries: in a multi-column flow the underlines end at
   different depths and read as ragged rather than as structure. */
.repo {
  display: grid;
  gap: 0.25rem;
  align-content: start;
}
.repo__link {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  width: fit-content;
}
.repo__link:hover { color: var(--blue-bright); }
.repo__desc { font-size: 0.82rem; color: var(--dim); line-height: 1.6; }
.repo__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.15rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.repo__lang { display: inline-flex; align-items: center; gap: 0.4rem; }
.repo__dot { width: 7px; height: 7px; border-radius: 50%; }

/* --- stack ---------------------------------------------------------------- */

/* Multi-column rather than a grid: the browser balances column heights for
   whatever number of groups exist, so a set that does not divide evenly into
   the track count never strands one group alone on a row of its own. */
.stack {
  columns: 250px 4;
  column-gap: 2rem;
  margin-top: 0.5rem;
}
.stack__group {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}
.stack__group:last-child { margin-bottom: 0; }
.stack__label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 0.6rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.014);
}

/* --- contact -------------------------------------------------------------- */

.contact__line { font-size: 0.85rem; color: var(--dim); line-height: 1.65; }
.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: auto;
  padding-top: 0.9rem;
}
.contact__links a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--line-hi);
  padding-bottom: 2px;
  transition: border-color 0.2s, color 0.2s;
}
.contact__links a:hover { color: var(--blue-bright); border-color: var(--blue); }

/* --- footer --------------------------------------------------------------- */

.footer {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.4rem clamp(1.15rem, 4vw, 3.5rem) 2.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- expanded panel ------------------------------------------------------- */

#overlay:empty { display: none; }

.overlay { position: fixed; inset: 0; z-index: 100; }

.panel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1rem, 5vh, 3.5rem) 1rem;
  overflow-y: auto;
}

.panel__scrim {
  position: fixed;
  inset: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(4, 6, 11, 0.8);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fade 0.25s ease-out;
}

.panel__sheet {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  padding: clamp(1.5rem, 4vw, 2.4rem);
  background: var(--panel);
  border: 1px solid var(--line-hi);
  border-radius: 12px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.65);
  animation: rise 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--line);
}
.panel__title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.4vw, 2.15rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-top: 0.65rem;
}
.panel__kicker { margin-top: 0.6rem; font-size: 0.84rem; color: var(--muted); }

.panel__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  background: transparent;
  border: 1px solid var(--line-hi);
  border-radius: 5px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.panel__close:hover { color: var(--text); border-color: var(--blue); }
.panel__close span {
  padding-left: 0.6rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.2rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}
.facts dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.facts dd { font-size: 0.87rem; color: var(--text); }

.prose { padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.prose__heading {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.85rem;
}
.prose p { font-size: 0.92rem; line-height: 1.78; color: var(--dim); }
.prose p + p { margin-top: 0.9rem; }

.bars { padding: 1.4rem 0; display: grid; gap: 0.8rem; }
.bars .prose__heading { margin-bottom: 0.3rem; }
.bar { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; align-items: center; }
.bar__label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.bar__track { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar__fill { display: block; height: 100%; background: var(--blue); }

.chips--panel { margin-top: 1.4rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 1000px) {
  .masthead { grid-template-columns: minmax(0, 1fr); }
  .masthead__deck { order: -1; }
}

@media (max-width: 680px) {
  .vitals__row { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
  .footer { flex-direction: column; gap: 0.5rem; }
}

/* --- reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
