/* ============================================================
   lukesomething — shared layout & components
   Implements lukesomething-style-guide.md v0.2 (§2, §5, §6, §7, §12)
   All values reference tokens in variables.css.
   ============================================================ */

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

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

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* ---------- Base ---------- */
body {
  background-color: var(--color-base);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Site-wide background treatment (guide §3 + §5.1):
   graphite base, a subtle warm amber ambient glow, and the faint
   46px background lattice from §6. Fixed so it's identical on
   every page and doesn't scroll away. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Grid lattice on top (46px cells), warm amber glow beneath —
     exact values from the coded style guide (canonical source). */
  background-image:
    linear-gradient(var(--gridline) 1px, transparent 1px),
    linear-gradient(90deg, var(--gridline) 1px, transparent 1px),
    radial-gradient(760px 480px at 88% -6%, rgba(245, 162, 30, 0.14), transparent 60%),
    radial-gradient(560px 520px at -4% 106%, rgba(245, 162, 30, 0.06), transparent 62%);
  background-size: 46px 46px, 46px 46px, 100% 100%, 100% 100%;
  background-repeat: repeat, repeat, no-repeat, no-repeat;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  color: var(--color-text);
}

h1 {
  font-size: var(--text-h1);
  font-weight: 800;
  letter-spacing: var(--tracking-headline);
}

h2 {
  font-size: var(--text-h2);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 { font-size: 18px; font-weight: 700; }

p {
  color: var(--color-text-secondary);
  font-size: var(--text-body);
}

code, kbd, pre {
  font-family: var(--font-mono);
}

/* Focus state (guide §12): 3px amber ring, never removed */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Reduced motion (guide §7): fades instead of transforms */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    transform: none !important;
  }
}

::selection {
  background: var(--color-accent);
  color: var(--color-accent-shade);
}

/* ---------- Layout helpers ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Wordmark (guide §2) ----------
   ›lukesomething.com — four-part treatment, deliberately two-tone:
   caret = amber, luke = bold off-white (full ink),
   something = a more muted tone than luke,
   .com = the most de-emphasized of all. */
.wordmark-caret {
  color: var(--color-accent);
  font-weight: 800;
}

.wordmark-luke {
  color: var(--color-ink);   /* full off-white, boldest of the wordmark */
}

.wordmark-something {
  color: var(--color-text-secondary);   /* muted grey — lighter/more muted than luke */
}

.wordmark-tld {
  color: var(--color-text-muted);        /* faint grey — most de-emphasized */
  font-weight: 500;
}

/* ---------- Site nav (frosted strip, guide §5.1) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 32px;
  background: var(--surface-glass-strong);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--color-text);
  letter-spacing: -0.01em;
  /* 44px hit target (guide §12) */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-icon);
  font-size: 14px;
  color: var(--color-text-secondary);
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-button);
  transition: color var(--duration-micro) var(--ease-spark),
              background-color var(--duration-micro) var(--ease-spark);
}

.nav-links a:hover {
  color: var(--color-ink);
  background: var(--color-border);
}

.nav-links a.active {
  color: var(--color-accent);
}

/* Narrow screens: let the nav wrap and tighten horizontal rhythm */
@media (max-width: 640px) {
  .nav {
    flex-wrap: wrap;
    padding: 8px 16px;
    row-gap: 0;
  }

  .nav-links {
    gap: 0;
    font-size: 13px;
  }

  .nav-links a {
    padding: 0 10px;
  }

  .breadcrumb,
  .page-header,
  .card-grid,
  .container,
  .site-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ---------- Breadcrumb (guide §2 tab layout) ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-card-gap) 32px 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-text-muted);
  transition: color var(--duration-micro) var(--ease-spark);
}

.breadcrumb a:hover {
  color: var(--color-accent);
}

.breadcrumb-sep {
  color: var(--color-text-muted);
}

.breadcrumb-current {
  color: var(--color-ink);
}

/* ---------- Page header & tab-integrated wordmark (guide §2) ---------- */
.page-header {
  padding: var(--space-block) 32px var(--space-card-pad);
}

/* lukeBUILDSsomething — tab word uppercase amber, same weight */
.page-header .wordmark {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(var(--text-h1), 6vw, var(--text-display));
  letter-spacing: var(--tracking-headline);
  line-height: 1.1;
  color: var(--color-ink);
}

.page-header .wordmark .highlight {
  color: var(--color-accent);
  font-weight: 800;
  text-transform: uppercase;
}

/* One-line tagline beneath, ink at muted tone */
.page-header .subtitle {
  font-size: var(--text-body);
  color: var(--color-text-secondary);
  margin-top: var(--space-icon);
  max-width: 460px;
}

/* Hero variant for the home page */
.page-header .hero-title {
  font-size: clamp(var(--text-h1), 6vw, var(--text-display));
  letter-spacing: var(--tracking-headline);
  line-height: 1.08;
}

/* Mono kicker label (guide §4.2: mono, ALL-CAPS, wide tracking) */
.kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-card-gap);
}

/* ---------- Project card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-card-gap);
  padding: var(--space-icon) 32px var(--space-section);
}

/* Capped-width variant for rows with only one or two cards */
.card-grid--capped {
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  justify-content: start;
}

/* Frosted glass card (guide §5.1): translucent tint over the
   graphite base, hairline border, light top edge for depth */
.card {
  position: relative;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(237, 236, 231, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.35);
  transition: border-color var(--duration-standard) var(--ease-spark),
              transform var(--duration-standard) var(--ease-spark),
              box-shadow var(--duration-standard) var(--ease-spark);
}

.card:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(237, 236, 231, 0.09),
    0 12px 32px rgba(0, 0, 0, 0.45);
}

.card-image {
  height: 130px;
  background: rgba(237, 236, 231, 0.04);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Video-style thumbnail (Films tab, 16:9) */
.card-image--video {
  height: auto;
  aspect-ratio: 16 / 9;
  position: relative;
}

.card-play-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--surface-glass-strong);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-body {
  padding: var(--space-card-pad);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text);
  margin-bottom: var(--space-hairline);
}

.card-description {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.card-external-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface-glass-strong);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-chip);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* External domain: mono label — the technical undertone (guide §4) */
.card-external-domain {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: var(--space-icon);
}

/* ---------- Buttons (guide §5.2) ----------
   Visible depth: light on the top edge, subtle shadow below. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-icon);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-button);
  transition: background-color var(--duration-micro) var(--ease-spark),
              border-color var(--duration-micro) var(--ease-spark),
              box-shadow var(--duration-micro) var(--ease-spark),
              transform var(--duration-micro) var(--ease-spark);
}

/* Primary — amber fill, graphite text/icon for legibility, one per view max */
.btn-accent {
  background: linear-gradient(180deg, var(--color-accent-tint), var(--color-accent) 45%);
  color: var(--color-base);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 4px 14px rgba(245, 162, 30, 0.25),
    0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-accent:hover {
  background: linear-gradient(180deg, var(--color-accent-tint), var(--color-accent-tint) 45%);
}

.btn-accent:active {
  background: var(--color-accent-shade);
  color: var(--color-base);
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Secondary — glass fill, ink text, hairline border */
.btn-secondary {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--color-ink);
  border: 1px solid var(--color-border-strong);
  box-shadow:
    inset 0 1px 0 rgba(237, 236, 231, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.35);
}

.btn-secondary:hover {
  border-color: rgba(237, 236, 231, 0.28);
}

/* Ghost — outline only */
.btn-ghost {
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  color: var(--color-ink);
  border-color: rgba(237, 236, 231, 0.28);
}

/* Text — inline link style, "Text link →" */
.link-text {
  color: var(--color-accent);
  font-weight: 600;
  transition: color var(--duration-micro) var(--ease-spark);
}

.link-text:hover {
  color: var(--color-accent-tint);
}

/* ---------- Chips (guide §5.3 / §5.5) ----------
   Key-cap sized: ~4px vertical / ~6–8px horizontal padding,
   mono, subtle contrast fill plus hairline border. */
.chip,
.kbd {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 4px 7px;
  border-radius: var(--radius-chip);
  background: rgba(237, 236, 231, 0.07);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

/* Status chip variant (e.g. ACTIVE, WIP) */
.chip--status {
  font-size: 10px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

/* Label + chip grouped tightly as one unit (guide §5.3) */
.action-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.action-divider {
  color: var(--color-border-strong);
  margin: 0 18px;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: var(--space-card-pad) 32px;
  border-top: 1px solid var(--color-border);
  background: var(--surface-glass-strong);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: color var(--duration-micro) var(--ease-spark);
}

.site-footer a:hover {
  color: var(--color-accent);
}
