/* ============================================================
   JAKOBSSON.INFO — style.css
   Architecture: Mobile-first, custom properties, no framework
   ============================================================ */

/* ── 1. DESIGN TOKENS ────────────────────────────────────── */
:root {
  /* Color palette */
  --color-bg:           #0f172a;   /* deep navy */
  --color-surface:      #1e293b;   /* card surface */
  --color-surface-hover:#243349;   /* card hover */
  --color-border:       #2d3f55;   /* subtle border */
  --color-accent:       #2dd4bf;   /* teal accent */
  --color-accent-dim:   #14b8a6;   /* accent pressed/darker */
  --color-text-primary: #f1f5f9;   /* near-white */
  --color-text-secondary:#94a3b8;  /* muted slate */
  --color-text-tertiary: #64748b;  /* dimmer labels */
  --color-tag-bg:       rgba(45, 212, 191, 0.10);
  --color-tag-text:     #2dd4bf;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  /* Spacing scale */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --container-max: 1100px;
  --container-pad: var(--space-6);

  /* Borders & radii */
  --radius-sm:  0.375rem;
  --radius-md:  0.625rem;
  --radius-lg:  0.875rem;
  --radius-pill:9999px;

  /* Shadows */
  --shadow-card:       0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-card-hover: 0 10px 30px rgba(0,0,0,0.5), 0 0 0 1px var(--color-border);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 220ms ease;
}

/* ── 2. RESET & BASE ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; }

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

ul, ol { list-style: none; }

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

.icon {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── 4. HERO ──────────────────────────────────────────────── */
.hero {
  position: relative;
  padding-block: var(--space-20) var(--space-16);
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

/* Radial glow behind content */
.hero__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 60% at 50% 0%,
    rgba(45, 212, 191, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__badge {
  display: inline-block;
  margin-bottom: var(--space-5);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.hero__title {
  font-size: clamp(var(--text-3xl), 6vw, var(--text-5xl));
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-5);
  color: var(--color-text-primary);
}

.hero__dot {
  color: var(--color-accent);
}

.hero__tagline {
  font-size: clamp(var(--text-base), 2.5vw, var(--text-xl));
  color: var(--color-text-secondary);
  max-width: 48ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
  font-weight: 400;
}

.hero__meta {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.hero__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

/* ── 5. SECTION HEADER ───────────────────────────────────── */
.projects {
  flex: 1;
  padding-block: var(--space-16) var(--space-20);
}

.section-header {
  margin-bottom: var(--space-10);
}

.section-header__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.section-header__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* ── 6. PROJECT GRID ──────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 560px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── 7. PROJECT CARD ──────────────────────────────────────── */
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base),
    border-color var(--transition-base);
  cursor: pointer;
  /* role=listitem set via JS */
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-4px);
  background-color: var(--color-surface-hover);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(45, 212, 191, 0.25);
}

/* Accent left-border strip on hover */
.project-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 12%;
  width: 3px;
  background: var(--color-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.project-card:hover::before,
.project-card:focus-within::before {
  opacity: 1;
}

/* Card header row */
.project-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

/* Category tag */
.project-card__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

/* External link icon top-right */
.project-card__ext-icon {
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast), transform var(--transition-fast);
  margin-top: 2px;
  flex-shrink: 0;
}

.project-card:hover .project-card__ext-icon {
  color: var(--color-accent);
  transform: translate(2px, -2px);
}

/* Card body */
.project-card__name {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
  line-height: 1.3;
}

.project-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.65;
  flex: 1;
  margin-bottom: var(--space-6);
}

/* CTA button */
.project-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
  align-self: flex-start;
  text-decoration: none;
}

.project-card__cta:hover,
.project-card__cta:focus-visible {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg);
  outline: none;
}

.project-card__cta:focus-visible {
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.4);
}

/* ── 8. EMPTY / ERROR STATES ─────────────────────────────── */
.state-empty,
.state-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-16) var(--space-4);
  color: var(--color-text-tertiary);
  font-size: var(--text-sm);
}

.noscript-notice {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

/* ── 9. FOOTER ───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-6);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.site-footer__copy,
.site-footer__note {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.site-footer__divider {
  color: var(--color-border);
}

/* ── 10. REDUCED MOTION ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .project-card:hover {
    transform: none;
  }
}
