/* =========================================================
   Emmanuel Narh Nartey — Portfolio
   main.css — design tokens, base, typography, layout
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root {
  /* Colour — dark navy-charcoal base, layered slate surfaces */
  --color-bg: #0b1220;
  --color-bg-alt: #0e1626;
  --color-surface-1: #121b2d;
  --color-surface-2: #172236;
  --color-surface-3: #1c2a41;
  --color-border: #263450;
  --color-border-soft: #1c2739;

  --color-text: #eef1f6;
  --color-text-muted: #aab4c6;
  --color-text-faint: #7c8aa3;

  --color-accent: #5b8bb0;       /* muted steel-blue */
  --color-accent-strong: #7ea9c9;
  --color-accent-soft: rgba(91, 139, 176, 0.14);
  --color-accent-border: rgba(91, 139, 176, 0.35);

  --color-positive: #4f9d78;     /* restrained emerald — status only */
  --color-positive-soft: rgba(79, 157, 120, 0.14);
  --color-positive-border: rgba(79, 157, 120, 0.35);

  --color-warning: #c99a52;
  --color-warning-soft: rgba(201, 154, 82, 0.14);
  --color-warning-border: rgba(201, 154, 82, 0.35);

  --color-focus: #8fc1e8;

  /* Typography */
  --font-heading: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --fs-3xl: 2.9rem;
  --fs-4xl: 3.6rem;

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.6;
  --lh-relaxed: 1.75;

  /* Spacing scale */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.25rem;
  --space-xl: 3.5rem;
  --space-2xl: 5rem;
  --space-3xl: 7rem;

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 780px;
  --container-pad: 1.5rem;

  /* Radius & shadow */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(2, 6, 16, 0.35);
  --shadow-lg: 0 20px 48px rgba(2, 6, 16, 0.45);

  /* Motion */
  --dur-fast: 160ms;
  --dur-base: 220ms;
  --dur-slow: 560ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

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

body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.nav-open {
  position: fixed;
  width: 100%;
}

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

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

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

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

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

table {
  border-collapse: collapse;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-4xl); font-weight: 800; }
h2 { font-size: var(--fs-3xl); font-weight: 800; }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); font-weight: 600; }
h6 { font-size: var(--fs-md); font-weight: 600; }

p {
  color: var(--color-text-muted);
  max-width: 68ch;
}

p + p {
  margin-top: var(--space-sm);
}

.lede {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--color-text-muted);
}

strong { color: var(--color-text); font-weight: 600; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-strong);
}

.eyebrow::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--color-accent);
  display: inline-block;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--space-2xl);
}

.section--tight {
  padding-block: var(--space-xl);
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-xl);
}

.section-head h2 {
  margin-top: var(--space-sm);
}

.section-head p {
  margin-top: var(--space-sm);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.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;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-sm);
  z-index: 1000;
  background: var(--color-accent);
  color: #0b1220;
  font-weight: 700;
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: top var(--dur-base) var(--ease-standard);
}

.skip-link:focus {
  top: var(--space-sm);
}

/* ---------- Focus states ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Page fade-in ---------- */
body {
  animation: page-fade-in var(--dur-slow) var(--ease-out) both;
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

/* ---------- Selection ---------- */
::selection {
  background: var(--color-accent-soft);
  color: var(--color-text);
}
