/* =============================================================
   links.alexandreleitao.com — link hub
   Derived from alexandreleitao.com theme:
   charcoal + Space Grotesk / IBM Plex + cool green accent.
   ============================================================= */

:root {
  --bg:            oklch(0.165 0.006 250);
  --bg-2:          oklch(0.195 0.007 250);
  --surface:       oklch(0.215 0.008 250);
  --surface-2:     oklch(0.255 0.009 250);
  --line:          oklch(1 0 0 / 0.09);
  --line-strong:   oklch(1 0 0 / 0.16);

  --text:          oklch(0.95 0.004 250);
  --text-muted:    oklch(0.74 0.008 250);
  --text-faint:    oklch(0.58 0.009 250);

  --accent:        oklch(0.74 0.12 165);
  --accent-bright: oklch(0.82 0.13 165);
  --accent-dim:    oklch(0.74 0.12 165 / 0.14);
  --accent-line:   oklch(0.74 0.12 165 / 0.35);
  --accent-ink:    oklch(0.18 0.02 165);

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

  --maxw: 560px;
  --radius: 16px;
  --radius-sm: 11px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }

/* --- Ambient background: faint grid + top glow (from main site hero) --- */
.bg-fx {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(820px 520px at 50% -6%, oklch(0.74 0.12 165 / 0.11), transparent 62%),
    linear-gradient(oklch(1 0 0 / 0.02) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / 0.02) 1px, transparent 1px);
  background-size: auto, 46px 46px, 46px 46px;
  mask-image: radial-gradient(130% 80% at 50% 0%, #000 45%, transparent 100%);
}

/* --- Shell --- */
.shell {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(22px, 5vw, 40px) clamp(20px, 5vw, 28px) 56px;
}

/* =============================================================
   Top bar — brand mark + language toggle
   ============================================================= */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: clamp(26px, 6vw, 40px);
}
.topbar__mark {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
  display: inline-flex; align-items: center; gap: 9px;
}
.topbar__mark .monogram {
  display: block; width: auto; height: 28px;
  transition: opacity .18s ease, transform .18s ease;
}
.topbar__mark:hover .monogram { opacity: 0.78; transform: translateY(-1px); }

.lang {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 3px; gap: 2px; background: oklch(0.165 0.006 250 / 0.5);
}
.lang button {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em;
  color: var(--text-faint); background: none; border: 0;
  padding: 6px 10px; border-radius: 6px;
  transition: color .15s ease, background .15s ease;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); font-weight: 500; }

/* =============================================================
   Profile
   ============================================================= */
.profile { text-align: center; margin-bottom: clamp(30px, 7vw, 46px); }
.profile__portrait {
  position: relative; width: clamp(116px, 30vw, 138px); aspect-ratio: 1;
  margin: 0 auto 22px;
}
.profile__portrait .frame {
  position: relative; width: 100%; height: 100%;
  border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 60px -34px oklch(0 0 0 / 0.9);
}
.profile__portrait .frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.18) contrast(1.02); }
.profile__portrait .corner { position: absolute; width: 16px; height: 16px; border: 1.5px solid var(--accent-line); }
.profile__portrait .corner.tl { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.profile__portrait .corner.br { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }
.profile__portrait .status {
  position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em;
  color: var(--text); background: oklch(0.165 0.006 250 / 0.86); backdrop-filter: blur(8px);
  border: 1px solid var(--line); padding: 4px 11px; border-radius: 100px;
}
.profile__portrait .status .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); position: relative; }
.profile__portrait .status .pulse::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid var(--accent); animation: pulse 2.6s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(2); opacity: 0; } }

.profile h1 { font-size: clamp(27px, 7vw, 34px); letter-spacing: -0.03em; }
.profile__title {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.04em;
  color: var(--accent); margin-top: 12px; text-wrap: balance;
}
.profile__bio {
  color: var(--text-muted); font-size: 15px; margin: 16px auto 0;
  max-width: 42ch; text-wrap: pretty;
}

/* =============================================================
   Section labels
   ============================================================= */
.group { margin-top: clamp(26px, 6vw, 34px); }
.group__label {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-faint);
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-inline: 2px;
}
.group__label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.stack { display: flex; flex-direction: column; gap: 11px; }

/* =============================================================
   Link card
   ============================================================= */
.link {
  position: relative; display: grid;
  grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  transition: transform .2s cubic-bezier(.16,.8,.3,1), border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.link:hover { transform: translateY(-3px); border-color: var(--accent-line); background: var(--surface-2); box-shadow: 0 18px 40px -30px oklch(0 0 0 / 0.9); }

.link__icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line);
  color: var(--text); transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.link:hover .link__icon { color: var(--accent-bright); border-color: var(--accent-line); background: var(--accent-dim); }
.link__icon svg { width: 21px; height: 21px; }

/* image logo icon (e.g. podcast) — no tile chrome */
.link__icon--img { background: none; border: 0; }
.link:hover .link__icon--img { background: none; border: 0; }
.link__icon--img img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 3px 8px oklch(0 0 0 / 0.5)); }

.link__body { min-width: 0; display: flex; flex-direction: column; }
.link__title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 16.5px; letter-spacing: -0.01em; line-height: 1.25; }
.link__desc { display: block; color: var(--text-muted); font-size: 13px; margin-top: 3px; text-wrap: pretty; }
.link__host { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); margin-top: 6px; letter-spacing: 0.01em; }

.link__arrow {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  display: grid; place-items: center; color: var(--text-faint);
  transition: color .2s ease, transform .2s ease;
}
.link:hover .link__arrow { color: var(--accent-bright); transform: translate(2px, -2px); }
.link__arrow svg { width: 16px; height: 16px; }

/* --- Featured (Personal Website) --- */
.link--featured {
  grid-template-columns: auto 1fr auto;
  padding: 20px 20px;
  border-color: var(--accent-line);
  background:
    linear-gradient(135deg, oklch(0.235 0.012 200), oklch(0.2 0.008 250));
  box-shadow: 0 24px 48px -34px oklch(0 0 0 / 0.95);
}
.link--featured::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius); pointer-events: none;
  background: radial-gradient(360px 200px at 88% 0%, var(--accent-dim), transparent 70%);
}
.link--featured:hover { border-color: var(--accent); background: linear-gradient(135deg, oklch(0.25 0.014 200), oklch(0.21 0.009 250)); }
.link--featured .link__icon { width: 50px; height: 50px; background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.link--featured:hover .link__icon { background: var(--accent-bright); color: var(--accent-ink); }
.link--featured .link__icon svg { width: 24px; height: 24px; }
.link--featured .link__title { font-size: 18.5px; }
.link--featured .link__badge {
  align-self: flex-start;
  display: inline-block; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent-bright);
  border: 1px solid var(--accent-line); border-radius: 100px; padding: 2px 8px; margin-bottom: 7px;
}
.link--featured .link__desc { font-size: 13.5px; }

/* =============================================================
   Footer
   ============================================================= */
.foot { margin-top: clamp(40px, 9vw, 56px); text-align: center; }
.foot__social { display: flex; justify-content: center; gap: 10px; margin-bottom: 24px; }
.foot__social a {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 11px; color: var(--text-muted);
  transition: color .18s ease, border-color .18s ease, transform .18s ease, background .18s ease;
}
.foot__social a:hover { color: var(--accent-bright); border-color: var(--accent-line); transform: translateY(-2px); background: var(--accent-dim); }
.foot__social svg { width: 18px; height: 18px; }

.foot__line { height: 1px; background: var(--line); max-width: 80px; margin: 0 auto 20px; }
.foot__copy { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); letter-spacing: 0.02em; line-height: 1.7; }
.foot__copy a { color: var(--text-muted); border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; transition: color .15s ease, border-color .15s ease; }
.foot__copy a:hover { color: var(--accent-bright); border-color: var(--accent-line); }

/* --- Language visibility: lang attr is always set by markup/JS --- */
html[lang="en"] [data-pt],
html[lang="pt-BR"] [data-en] { display: none !important; }

@media (max-width: 380px) {
  .link { padding: 14px 14px; gap: 12px; }
  .link__icon { width: 40px; height: 40px; }
  .link__host { display: none; }
}
