/* ============================================================
   matheusnahal.com — shared styles
   Dark "ink" theme. Signature motif: the jiu-jitsu belt
   progression (white -> blue -> purple -> brown -> black),
   used as a recurring structural divider.
   ============================================================ */

/* ---- Fonts (self-hosted, no external CDN) ---- */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

/* ---- Tokens ---- */
:root {
  --bg:        #0d0e11;
  --bg-elev:   #15171c;
  --bg-elev-2: #1a1d23;
  --line:      #23262e;
  --line-soft: #1b1e24;
  --ink:       #ece9e3;          /* warm off-white */
  --ink-dim:   #969ba5;
  --ink-faint: #5b606a;
  --accent:    #5c7cfa;
  --accent-hi: #8fa4ff;

  /* belt progression */
  --belt-white:  #e8e3d8;
  --belt-blue:   #2b50c8;
  --belt-purple: #6e3fb0;
  --belt-brown:  #6a4429;
  --belt-black:  #16181d;

  --display: "Space Grotesk", system-ui, sans-serif;
  --body:    "IBM Plex Sans", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --maxw: 1080px;
  --pad:  clamp(20px, 5vw, 56px);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* subtle vertical light from the top, like a mat under a single lamp */
  background-image: radial-gradient(120% 80% at 50% -10%, #15171c 0%, var(--bg) 55%);
  background-attachment: fixed;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---- Layout shell ---- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }

/* ---- Belt motif ---- */
.belt {
  display: flex; height: 4px; width: 100%; border-radius: 99px; overflow: hidden;
}
.belt > i { flex: 1; }
.belt > i:nth-child(1) { background: var(--belt-white); }
.belt > i:nth-child(2) { background: var(--belt-blue); }
.belt > i:nth-child(3) { background: var(--belt-purple); }
.belt > i:nth-child(4) { background: var(--belt-brown); }
.belt > i:nth-child(5) { background: var(--belt-black); }
/* a single black bar carries one red "stripe" (faixa preta detail) */
.belt > i:nth-child(5) {
  background: linear-gradient(90deg, var(--belt-black) 0 78%, #b32525 78% 90%, var(--belt-black) 90%);
}

/* ---- Header / nav ---- */
.site-head { position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between;
  height: 64px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px;
  font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; font-size: 18px; }
.brand .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--accent);
  align-self: center; }
.brand .sub { font-family: var(--mono); font-weight: 400; font-size: 11px;
  color: var(--ink-faint); letter-spacing: 0.04em; text-transform: uppercase; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em;
  color: var(--ink-dim); padding: 8px 14px; border-radius: 8px; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--ink); background: var(--bg-elev); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::before { content: "▸ "; color: var(--accent); }

/* ---- Eyebrow / labels ---- */
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); }

/* ---- Hero ---- */
.hero { padding-top: clamp(56px, 12vh, 130px); padding-bottom: clamp(40px, 8vh, 80px); }
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(48px, 11vw, 116px); line-height: 0.92;
  letter-spacing: -0.035em; margin: 18px 0 0;
}
.hero h1 .last { color: var(--ink-dim); }
.hero .lead { max-width: 52ch; margin: 26px 0 0; font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-dim); line-height: 1.55; }
.hero .belt { margin-top: 38px; max-width: 460px; }

/* ---- Buttons ---- */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn { display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em;
  padding: 12px 18px; border-radius: 10px; border: 1px solid var(--line);
  transition: border-color .15s, background .15s, transform .05s; }
.btn:hover { border-color: var(--accent); background: var(--bg-elev); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #0b0d18; font-weight: 500; }
.btn--primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- Sections ---- */
section { padding-block: clamp(48px, 9vh, 96px); }
.section-rule { border-top: 1px solid var(--line-soft); }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 36px; }
.section-head h2 { font-family: var(--display); font-weight: 500; font-size: clamp(22px, 3.4vw, 32px);
  letter-spacing: -0.02em; margin: 0; }

/* ---- Discipline columns ---- */
.cols { display: grid; gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden;
  grid-template-columns: repeat(3, 1fr); }
.col { background: var(--bg-elev); padding: 26px 24px 30px; }
.col .n { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.col h3 { font-family: var(--display); font-weight: 500; font-size: 19px; margin: 14px 0 10px;
  letter-spacing: -0.01em; }
.col p { margin: 0; font-size: 15px; color: var(--ink-dim); line-height: 1.55; }
.col .tag { display: inline-block; margin-top: 16px; font-family: var(--mono); font-size: 11.5px;
  color: var(--ink-faint); }

/* ---- Portfolio grid ---- */
.cards { display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); }
.card { background: var(--bg-elev); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 26px 24px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color .15s, transform .12s, background .15s; }
.card:hover { border-color: var(--line); transform: translateY(-2px); }
.card .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card h3 { font-family: var(--display); font-weight: 500; font-size: 20px; margin: 0;
  letter-spacing: -0.01em; }
.card .status { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line);
  color: var(--ink-dim); white-space: nowrap; }
.card .status.live { color: #79e0a8; border-color: #2c5a42; }
.card .status.dev  { color: #e0c879; border-color: #5a4f2c; }
.card .status.priv { color: var(--ink-faint); }
.card p { margin: 0; font-size: 15px; color: var(--ink-dim); line-height: 1.55; flex: 1; }
.card .stack { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.card .open { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-top: 4px; }
.card a.cardlink::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }

/* ---- Index / sitemap list ---- */
.maplist { border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; }
.maprow { display: flex; align-items: center; gap: 18px; padding: 20px 22px;
  background: var(--bg-elev); border-bottom: 1px solid var(--line-soft);
  transition: background .15s; }
.maprow:last-child { border-bottom: 0; }
.maprow:hover { background: var(--bg-elev-2); }
.maprow .idx { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); width: 28px; }
.maprow .meta { flex: 1; min-width: 0; }
.maprow .meta .t { font-family: var(--display); font-weight: 500; font-size: 18px; }
.maprow .meta .d { font-size: 14px; color: var(--ink-dim); margin-top: 2px; }
.maprow .path { font-family: var(--mono); font-size: 13px; color: var(--accent);
  white-space: nowrap; }
.maprow .path.ext::after { content: " ↗"; color: var(--ink-faint); }
.maprow .lock { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

/* ---- Admin gate ---- */
.gate { min-height: 62vh; display: grid; place-content: center; text-align: center; gap: 18px; }
.gate .seal { width: 52px; height: 52px; margin: 0 auto; border-radius: 14px;
  border: 1px solid var(--line); display: grid; place-content: center; background: var(--bg-elev); }
.gate h1 { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 5vw, 40px);
  letter-spacing: -0.02em; margin: 0; }
.gate p { color: var(--ink-dim); max-width: 46ch; margin: 0 auto; }
.gate .note { font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint);
  border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 16px; max-width: 460px; margin: 8px auto 0; }

/* ---- Footer ---- */
.site-foot { border-top: 1px solid var(--line-soft); margin-top: 40px; padding-block: 40px; }
.foot-grid { display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; }
.foot-grid .belt { max-width: 220px; }
.foot-grid .meta { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.foot-links { display: flex; gap: 18px; font-family: var(--mono); font-size: 13px; }
.foot-links a { color: var(--ink-dim); }
.foot-links a:hover { color: var(--ink); }

/* ---- Page intro (shared by subpages) ---- */
.page-intro { padding-top: clamp(40px, 9vh, 90px); padding-bottom: 8px; }
.page-intro h1 { font-family: var(--display); font-weight: 700; letter-spacing: -0.03em;
  font-size: clamp(36px, 7vw, 64px); margin: 14px 0 0; line-height: 1; }
.page-intro p { color: var(--ink-dim); max-width: 56ch; margin: 18px 0 0; }
.page-intro .belt { margin-top: 26px; max-width: 360px; }

/* ---- Focus + motion ---- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- Responsive ---- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .cols { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .brand .sub { display: none; }
  .maprow { flex-wrap: wrap; gap: 8px 14px; }
  .maprow .path { width: 100%; }
  .section-head { flex-direction: column; gap: 6px; }
}
