/* ==========================================================================
   Abir Al Zubayer — Portfolio
   1. Design tokens
   2. Reset & base
   3. Layout primitives
   4. Typography
   5. Components (buttons, cards, badges)
   6. Utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --gold: #f4a300;
  --gold-600: #d98f00;
  /* Darker gold for gold-on-light text/icons, where --gold fails contrast */
  --gold-700: #a86e00;
  --gold-100: #fff3d6;
  --gold-50: #fffaf0;

  /* Neutrals */
  --ink: #1a1a1a;
  --ink-900: #101010;
  --slate: #4b5563;
  --muted: #6b7280;
  --navy: #0f1548;
  --muted-plum: #5d586c;
  --line: #e5e7eb;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #f2f4f7;

  /* Accents used by article/knowledge cards */
  --accent-blue: #3b82f6;
  --accent-violet: #7c3aed;
  --tint-cream: #fdf3dc;
  --tint-lilac: #f4f2fe;

  /* Typography */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* Fluid type scale — display max derives from the reference H1 ink (h=91 → ~94px) */
  --fs-display: clamp(2.75rem, 1.1rem + 6.2vw, 5.875rem);
  --fs-h1: clamp(2rem, 0.95rem + 4.4vw, 4rem);
  --fs-h2: clamp(1.75rem, 1.05rem + 2.9vw, 3.25rem);
  --fs-h3: clamp(1.125rem, 0.98rem + 0.62vw, 1.5rem);
  --fs-lead: clamp(1rem, 0.94rem + 0.28vw, 1.125rem);
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.8125rem;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --section-y: clamp(3.5rem, 2rem + 6vw, 7rem);

  /* Shell */
  --shell-max: 1248px;
  --shell-pad: clamp(1rem, 0.4rem + 2.6vw, 2.5rem);

  /* Radii */
  --r-sm: 8px;
  --r-md: 8px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 40px;
  --r-pill: 999px;

  /* Elevation */
  --sh-sm: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 10%);
  --sh-md: 0 4px 8px -2px rgb(16 24 40 / 10%), 0 2px 4px -2px rgb(16 24 40 / 6%);
  --sh-lg: 0 12px 16px -4px rgb(16 24 40 / 8%), 0 4px 6px -2px rgb(16 24 40 / 3%);
  --sh-xl: 0 20px 24px -4px rgb(16 24 40 / 8%), 0 8px 8px -4px rgb(16 24 40 / 3%);
  --sh-card: 0 18px 40px -12px rgb(16 24 40 / 18%);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.45s;

  /* Inline assets — a single 24x19 star tile, repeated by .stars */
  --star-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 19"><path d="m12 0 2.9 6.03 6.63.88-4.83 4.6 1.2 6.57L12 14.9l-5.9 3.18 1.2-6.57L2.47 6.91l6.63-.88z" fill="%23000"/></svg>');

  /* Sticky header offset for anchor targets */
  --header-h: 74px;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.12;
  text-wrap: balance;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--gold);
  color: #fff;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.shell {
  width: min(100% - (var(--shell-pad) * 2), var(--shell-max));
  margin-inline: auto;
}

/* Near-full-bleed variant for the slate panels (reference: x=16, w=1408). */
.shell--wide {
  --shell-max: 1408px;
  --shell-pad: 16px;
}

.section {
  padding-block: var(--section-y);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: #fff;
  border-radius: 0 0 var(--r-sm) 0;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

/* --------------------------------------------------------------------------
   4. Typography helpers
   -------------------------------------------------------------------------- */
.eyebrow {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--slate);
  letter-spacing: 0.01em;
  margin-bottom: var(--sp-3);
}

.section-title {
  font-size: var(--fs-h2);
  color: var(--slate);
  font-weight: 700;
}

.section-title--upper {
  text-transform: uppercase;
  letter-spacing: -0.015em;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
  margin-bottom: var(--sp-7);
}

/* --------------------------------------------------------------------------
   5. Components — buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-lg);
}

.btn:active {
  transform: translateY(0);
}

.btn svg {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn--gold {
  --btn-bg: var(--gold);
  --btn-fg: var(--ink);
}

.btn--gold:hover {
  --btn-bg: var(--gold-600);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border: 1px solid var(--ink);
}

.btn--ghost:hover {
  --btn-bg: var(--surface-3);
}

.btn--outline-gold {
  --btn-bg: transparent;
  --btn-fg: #fff;
  border: 1px solid var(--gold);
}

.btn--outline-gold:hover {
  --btn-bg: var(--gold);
  --btn-fg: var(--ink);
}

.btn--sm {
  padding: 0.55rem 1rem;
  font-size: var(--fs-xs);
}

/* Paired dark button + gold arrow tile — flush in the reference (btn 180x55
   at x=1122, tile 55.9 at x=1302), so no gap between them. */
.btn-pair {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  flex: none;
}

.btn-pair .btn {
  border-radius: var(--r-md);
  min-width: 180px;
  height: 55px;
}

.btn-tile {
  display: grid;
  place-items: center;
  width: 56px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--ink);
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn-tile:hover {
  background: var(--gold-600);
  transform: translateY(-2px);
}

.btn-tile svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The 180px + 56px pair overflows narrow phones, so let it fill the row. */
@media (max-width: 420px) {
  .btn-pair {
    width: 100%;
  }

  .btn-pair .btn {
    min-width: 0;
    flex: 1;
  }
}

/* --------------------------------------------------------------------------
   6. Utilities
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.text-gold {
  color: var(--gold);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
