/* ============================================================
   Fabrício Parra — Portfolio
   B&W minimal, fine lines + grain texture, Space Grotesk
   ============================================================ */

:root {
  --bg: #f6f5f2;
  --bg-deep: #ecebe7;
  --ink: #0a0a0a;
  --ink-soft: #1c1c1c;
  --muted: #555;
  --muted-2: #888;
  --hairline: rgba(10, 10, 10, 0.12);
  --hairline-strong: rgba(10, 10, 10, 0.25);
  --inv: #f6f5f2;

  --maxw: 1440px;
  --gutter: clamp(20px, 4vw, 56px);

  --t-display: clamp(64px, 12vw, 200px);
  --t-h1: clamp(40px, 7vw, 96px);
  --t-h2: clamp(28px, 4vw, 56px);
  --t-h3: clamp(20px, 2.2vw, 28px);
  --t-body: clamp(15px, 1.05vw, 17px);
  --t-small: 12px;

  --ease: cubic-bezier(0.65, 0, 0.05, 1);
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-deep: #050505;
  --ink: #f6f5f2;
  --ink-soft: #e0e0e0;
  --muted: #aaa;
  --muted-2: #777;
  --hairline: rgba(246, 245, 242, 0.14);
  --hairline-strong: rgba(246, 245, 242, 0.3);
  --inv: #0a0a0a;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
}

/* Grain overlay --------------------------------------------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: 0.25; }

/* Type ------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}
.italic-serif { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; letter-spacing: 0; text-transform: uppercase; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: var(--ink); color: var(--inv); }

/* Layout ------------------------------------------------------ */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.hairline {
  border-bottom: 1px solid var(--hairline);
}
.hairline-top {
  border-top: 1px solid var(--hairline);
}

/* Cursor ------------------------------------------------------ */
.cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s;
  mix-blend-mode: difference;
  display: none;
}
@media (min-width: 900px) {
  .cursor { display: block; }
}
.cursor.hover {
  width: 60px;
  height: 60px;
  background: #fff;
}
.cursor.zoom {
  width: 64px;
  height: 64px;
  background: #fff;
  mix-blend-mode: normal;
}
.cursor.zoom::after {
  content: "+";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%);
  color: #0a0a0a;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

@keyframes lightboxIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* App / Pages ------------------------------------------------- */
.app {
  position: relative;
  min-height: 100vh;
}

.page {
  position: relative;
  min-height: 100vh;
  padding-top: 90px;
}

/* Reveal helpers --------------------------------------------- */
.reveal-line {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.reveal-line > span {
  display: inline-block;
  transform: translateY(110%);
}

/* Page transition overlay ------------------------------------ */
.page-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  pointer-events: none;
  background: var(--ink);
  transform: translateY(100%);
  will-change: transform;
}

/* Buttons ----------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 26px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.02em;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.5s var(--ease);
  z-index: 0;
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: var(--inv); }
.btn > * { position: relative; z-index: 1; }
.btn .arrow {
  width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}

.btn-solid {
  background: var(--ink);
  color: var(--inv);
}
.btn-solid::before { background: var(--bg); }
.btn-solid:hover { color: var(--ink); }

/* Hairline circle motif --------------------------------------- */
.circle-motif {
  position: absolute;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  pointer-events: none;
}

/* Utility ----------------------------------------------------- */
.muted { color: var(--muted); }
.uppercase { text-transform: uppercase; letter-spacing: 0.06em; }

/* Scrollbar (subtle) ----------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 3px; }
