/* ============================================================
   ElektroDefter — style.css
   Theme: The Engineering Notebook (Kareli Defter)
   Fonts: Fira Code (mono/display) · DM Sans (body)
   ============================================================ */


/* ============================================================
   0. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  /* Paper & Background */
  --paper:          #faf9f4;
  --paper-dark:     #f2f0e8;
  --paper-shadow:   #e8e5d8;
  --grid-line:      rgba(180, 200, 220, 0.45);
  --grid-line-h:    rgba(160, 185, 210, 0.30);
  --margin-line:    rgba(220, 80, 80, 0.25);
  --grid-size:      28px;

  /* Ink Colors */
  --ink:            #1e2a38;
  --ink-secondary:  #4a5568;
  --ink-muted:      #8898aa;
  --ink-faint:      #b8c4ce;

  /* Accent / Highlighters */
  --accent-yellow:  #ffe066;
  --accent-green:   #b8f5c8;
  --accent-blue:    #a8d8f0;
  --accent-red:     #ffb3b3;
  --accent-orange:  #ffd4a0;

  /* Difficulty Badge Colors */
  --badge-kolay-bg:   #c8f5d8;
  --badge-kolay-ink:  #1a6b3a;
  --badge-kolay-border: #5ec47a;
  --badge-orta-bg:    #fde5bc;
  --badge-orta-ink:   #7a4210;
  --badge-orta-border: #f0a040;
  --badge-zor-bg:     #ffd0d0;
  --badge-zor-ink:    #7a1a1a;
  --badge-zor-border: #e06060;

  /* UI Chrome */
  --border:         #ccc8b8;
  --border-strong:  #a09880;
  --border-rule:    #2c3e50;
  --shadow-sm:      2px 3px 8px rgba(60, 50, 30, 0.10);
  --shadow-md:      4px 6px 18px rgba(60, 50, 30, 0.14);
  --shadow-card:    3px 5px 20px rgba(60, 50, 30, 0.12),
                    0 1px 3px rgba(60, 50, 30, 0.08);
  --shadow-lift:    6px 10px 32px rgba(60, 50, 30, 0.20);

  /* Radius */
  --radius-sm:      3px;
  --radius-md:      6px;
  --radius-lg:      10px;
  --radius-pill:    100px;

  /* Spacing Scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* Typography */
  --font-mono:  'Fira Code', 'Courier New', monospace;
  --font-body:  'DM Sans', 'Segoe UI', sans-serif;

  --text-xs:   0.72rem;
  --text-sm:   0.85rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.3rem;
  --text-2xl:  1.6rem;
  --text-3xl:  2.1rem;
  --text-4xl:  2.8rem;
  --text-5xl:  3.8rem;

  /* Layout */
  --container-max: 1200px;
  --container-pad: clamp(var(--sp-4), 5vw, var(--sp-10));

  /* Transitions */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:   120ms;
  --dur-base:   220ms;
  --dur-slow:   400ms;
}


/* ============================================================
   1. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);

  /* ── Graph paper: fine minor grid + bolder major grid ── */
  background-image:
    /* Margin line at ~72px from left */
    linear-gradient(90deg, transparent 71px, var(--margin-line) 71px, var(--margin-line) 73px, transparent 73px),
    /* Major grid — every 4 cells */
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    /* Minor grid */
    linear-gradient(var(--grid-line-h) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-h) 1px, transparent 1px);
  background-size:
    100% 100%,
    calc(var(--grid-size) * 4) calc(var(--grid-size) * 4),
    calc(var(--grid-size) * 4) calc(var(--grid-size) * 4),
    var(--grid-size) var(--grid-size),
    var(--grid-size) var(--grid-size);
  background-attachment: local;

  min-height: 100vh;
  overflow-x: hidden;
}

/* Screen-reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Container */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Lists without default bullets */
ul, ol {
  list-style: none;
}

/* Link base */
a {
  color: inherit;
  text-decoration: none;
}

/* Images */
img, svg {
  display: block;
  max-width: 100%;
}

/* Focus ring — keyboard-friendly */
:focus-visible {
  outline: 2.5px dashed var(--ink);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Page-load fade-in */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
body {
  animation: pageFadeIn 0.45s var(--ease-out) both;
}


/* ============================================================
   2. TYPOGRAPHY SYSTEM
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl);  }

p  { font-family: var(--font-body); }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}


/* ============================================================
   3. GLOBAL BUTTON SYSTEM
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  padding: 0.62rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-base) var(--ease-out),
    border-color     var(--dur-base) var(--ease-out),
    color            var(--dur-base) var(--ease-out),
    transform        var(--dur-fast) var(--ease-spring),
    box-shadow       var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  background: none;
}

/* Ink-sketch border feel — pseudo underline decoration */
.btn::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 8%;
  width: 84%; height: 2px;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out),
              bottom  var(--dur-base) var(--ease-out);
}

/* Primary — filled ink button */
.btn--primary {
  background-color: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--border-strong);
}
.btn--primary:hover {
  background-color: var(--ink-secondary);
  border-color: var(--ink-secondary);
  box-shadow: 5px 5px 0 var(--border-strong);
  transform: translate(-1px, -1px);
}
.btn--primary:active {
  box-shadow: 1px 1px 0 var(--border-strong);
  transform: translate(1px, 1px);
}

/* Secondary — outlined */
.btn--secondary {
  background-color: transparent;
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--border);
}
.btn--secondary:hover {
  background-color: var(--accent-yellow);
  border-color: var(--ink);
  box-shadow: 5px 5px 0 var(--border);
  transform: translate(-1px, -1px);
}
.btn--secondary:active {
  box-shadow: 1px 1px 0 var(--border);
  transform: translate(1px, 1px);
}

/* Ghost — text only */
.btn--ghost {
  color: var(--ink-secondary);
  border-color: transparent;
  padding-inline: var(--sp-2);
}
.btn--ghost::after {
  opacity: 0.35;
  bottom: 2px;
}
.btn--ghost:hover {
  color: var(--ink);
  background-color: var(--accent-yellow);
  border-color: transparent;
}
.btn--ghost:hover::after {
  opacity: 0.7;
}

/* Inspect — card CTA */
.btn--inspect {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  background-color: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink-secondary);
  border-radius: var(--radius-sm);
}
.btn--inspect:hover {
  background-color: var(--accent-yellow);
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-1px, -1px);
}
.btn--inspect:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

/* Large modifier */
.btn--large {
  font-size: var(--text-base);
  padding: 0.85rem 1.75rem;
}

/* Add-project icon */
.btn--add-project .btn__icon {
  font-size: 1.1em;
  font-weight: 300;
  line-height: 1;
}


/* ============================================================
   4. HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--paper);
  /* Graph paper continues through header via transparency on background */
  background-image:
    linear-gradient(var(--grid-line-h) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-h) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);

  /* Hand-drawn thick bottom border — double line trick */
  border-bottom: 3px solid var(--ink);
  box-shadow:
    0 2px 0 0 var(--paper-dark),
    0 3px 0 0 var(--ink),
    0 5px 18px rgba(60, 50, 30, 0.10);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding-block: var(--sp-4);
}

/* Logo */
.site-logo {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-bracket {
  color: var(--ink-muted);
  font-weight: 300;
  font-size: 1.2em;
  line-height: 1;
}
.logo-text {
  padding-inline: 0.05em;
}

/* Blinking cursor animation */
.logo-cursor {
  font-weight: 300;
  color: var(--ink-secondary);
  animation: blink 1.1s step-start infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Header Nav */
.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}
.header-nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.header-nav__link {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--ink-secondary);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  position: relative;
  transition: color var(--dur-base) var(--ease-out);
}
/* Highlighter hover effect */
.header-nav__link::before {
  content: '';
  position: absolute;
  bottom: 4px; left: 6px;
  right: 6px; height: 8px;
  background-color: var(--accent-yellow);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
  border-radius: 2px;
}
.header-nav__link:hover,
.header-nav__link--active {
  color: var(--ink);
}
.header-nav__link:hover::before,
.header-nav__link--active::before {
  transform: scaleX(1);
}


/* ============================================================
   5. HERO SECTION
   ============================================================ */
.hero-section {
  position: relative;
  padding-block: var(--sp-16) var(--sp-12);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-10);
  align-items: center;
}

/* Eye brow label */
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-bottom: var(--sp-3);
  letter-spacing: 0.04em;
}

/* Headline */
.hero-headline {
  font-size: clamp(var(--text-3xl), 5.5vw, var(--text-5xl));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-5);
  /* Slight underline decoration on the text — pencil stroke feel */
  position: relative;
}

.hero-headline__accent {
  font-style: normal;
  display: inline-block;
  position: relative;
}
/* Yellow highlighter swipe under accent */
.hero-headline__accent::after {
  content: '';
  position: absolute;
  bottom: 4px; left: -2px;
  width: calc(100% + 4px);
  height: 0.45em;
  background-color: var(--accent-yellow);
  z-index: -1;
  transform: rotate(-0.8deg) skewX(-3deg);
  opacity: 0.75;
}

/* Sub text */
.hero-subtext {
  font-size: var(--text-lg);
  color: var(--ink-secondary);
  line-height: 1.7;
  max-width: 52ch;
  margin-bottom: var(--sp-8);
}

/* Hero actions */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

/* Notebook doodle panel */
.hero-notebook-doodle {
  width: clamp(200px, 22vw, 280px);
  aspect-ratio: 3 / 4;
  background-color: rgba(255, 255, 255, 0.55);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transform: rotate(1.5deg);
  padding: var(--sp-5);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Inner ruled lines of the doodle card */
.sketch-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px);
  background-size: 100% var(--grid-size);
  opacity: 0.6;
}

.sketch-circuit {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding-top: var(--sp-6);
}

.sketch-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1.5px solid;
  width: fit-content;
}
.sketch-label--vcc  { background: var(--accent-red);    color: var(--badge-zor-ink);    border-color: var(--badge-zor-border);   }
.sketch-label--gnd  { background: var(--paper-shadow);  color: var(--ink-secondary);    border-color: var(--border-strong);      }
.sketch-label--pin  { background: var(--accent-blue);   color: #1a4060;                 border-color: #60a8d0;                   }

.sketch-annotation {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-style: italic;
  margin-top: auto;
  padding-top: var(--sp-4);
}

/* Decorative ruled lines at bottom of hero */
.hero-ruled-lines {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--grid-size);
  pointer-events: none;
  overflow: hidden;
}
.ruled-line {
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--grid-line);
}


/* ============================================================
   6. STATS BAR
   ============================================================ */
.stats-bar {
  background-color: var(--ink);
  color: var(--paper);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.stats-bar__inner {
  padding-block: var(--sp-4);
}

.stats-list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.stats-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding-inline: var(--sp-10);
}

.stats-item--divider {
  width: 1px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.20);
  padding: 0;
  flex-direction: row;
}

.stats-item__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 400;
}
.stats-item__value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent-yellow);
  line-height: 1;
}


/* ============================================================
   7. FILTER BAR
   ============================================================ */
.filter-bar {
  padding-block: var(--sp-6) var(--sp-5);
  border-bottom: 1.5px solid var(--border);
  position: sticky;
  top: var(--header-height, 73px);
  z-index: 90;
  background-color: var(--paper);
  /* Subtle paper texture continuation */
  background-image:
    linear-gradient(var(--grid-line-h) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-h) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}

.filter-bar__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.filter-bar__label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Filter list */
.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  flex: 1;
}

/* Filter buttons — index-tab aesthetic */
.filter-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1.5px solid var(--border);
  border-bottom: none;
  background-color: var(--paper-dark);
  color: var(--ink-secondary);
  cursor: pointer;
  position: relative;
  transition:
    background-color var(--dur-base) var(--ease-out),
    color            var(--dur-base) var(--ease-out),
    transform        var(--dur-fast) var(--ease-out),
    box-shadow       var(--dur-base) var(--ease-out);
  /* Simulate tab sticking up from notebook edge */
  bottom: -1.5px;
}

/* Tab "resting" shadow */
.filter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 -3px 0 0 rgba(0,0,0,0.06);
  pointer-events: none;
}

/* Highlighter marker underline on hover */
.filter-btn::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 15%;
  width: 70%; height: 3px;
  background-color: var(--accent-yellow);
  transform: scaleX(0);
  transition: transform var(--dur-base) var(--ease-spring);
  border-radius: var(--radius-pill);
}

.filter-btn:hover {
  background-color: var(--paper);
  color: var(--ink);
  transform: translateY(-2px);
}
.filter-btn:hover::after {
  transform: scaleX(1);
}

/* Active filter tab */
.filter-btn--active,
.filter-btn[aria-pressed="true"] {
  background-color: var(--paper);
  color: var(--ink);
  border-color: var(--border-strong);
  font-weight: 600;
  transform: translateY(-3px);
  box-shadow: 0 -2px 0 0 var(--accent-yellow);
}
.filter-btn--active::after,
.filter-btn[aria-pressed="true"]::after {
  background-color: var(--accent-yellow);
  transform: scaleX(1);
}

/* Difficulty-colored active states */
.filter-btn--kolay:hover,
.filter-btn--kolay[aria-pressed="true"] {
  box-shadow: 0 -2px 0 0 var(--badge-kolay-border);
}
.filter-btn--kolay[aria-pressed="true"]::after {
  background-color: var(--badge-kolay-bg);
}
.filter-btn--orta:hover,
.filter-btn--orta[aria-pressed="true"] {
  box-shadow: 0 -2px 0 0 var(--badge-orta-border);
}
.filter-btn--orta[aria-pressed="true"]::after {
  background-color: var(--badge-orta-bg);
}
.filter-btn--zor:hover,
.filter-btn--zor[aria-pressed="true"] {
  box-shadow: 0 -2px 0 0 var(--badge-zor-border);
}
.filter-btn--zor[aria-pressed="true"]::after {
  background-color: var(--badge-zor-bg);
}

/* Search input */
.filter-bar__search {
  margin-left: auto;
  flex-shrink: 0;
}
.search-input {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink);
  background-color: rgba(255,255,255,0.7);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-4);
  width: 220px;
  transition:
    border-color var(--dur-base) var(--ease-out),
    box-shadow   var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out);
  outline: none;
}
.search-input::placeholder {
  color: var(--ink-faint);
}
.search-input:focus {
  border-color: var(--ink);
  background-color: var(--paper);
  box-shadow: 3px 3px 0 var(--border);
}


/* ============================================================
   8. PROJECTS GRID
   ============================================================ */
.projects-grid {
  padding-block: var(--sp-10) var(--sp-16);
}

.projects-grid__inner {
  width: 100%;
}

/* Grid header row */
.projects-grid__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-3);
  border-bottom: 1px dashed var(--border);
}

.projects-grid__title {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--ink);
}
/* Bracket decoration for the title */
.projects-grid__title::before {
  content: '// ';
  color: var(--ink-muted);
  font-weight: 300;
}

.projects-grid__count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

/* Responsive card grid */
.cards-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: var(--sp-8);
  align-items: start;
}


/* ============================================================
   9. PROJECT CARD — "Torn Paper Taped to Notebook" Look
   ============================================================ */

/* Stagger entrance animation */
@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(var(--card-rotate, 0deg));
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(var(--card-rotate, 0deg));
  }
}

.project-card {
  --card-rotate: -0.6deg;

  position: relative;
  display: flex;
  gap: 0;
  background-color: #fffef8;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);

  transform: rotate(var(--card-rotate));
  transition:
    transform  var(--dur-slow) var(--ease-spring),
    box-shadow var(--dur-slow) var(--ease-out);

  overflow: hidden;
  /* animation moved to .card--animate class — applied by JS on first load only */
}

/* Individual rotation per card via nth-child */
.project-card:nth-child(1) { --card-rotate: -0.7deg; }
.project-card:nth-child(2) { --card-rotate:  0.5deg; }
.project-card:nth-child(3) { --card-rotate: -0.3deg; }
.project-card:nth-child(4) { --card-rotate:  0.8deg; }

/* Card lift on hover */
.project-card:hover {
  --card-rotate: 0deg;
  box-shadow: var(--shadow-lift);
  transform: rotate(0deg) translateY(-4px);
  z-index: 2;
}

/* Tape strip across the top of card — CSS only */
.project-card::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 64px;
  height: 22px;
  background-color: rgba(255, 224, 102, 0.55);
  border: 1px solid rgba(200, 170, 60, 0.35);
  border-radius: 2px;
  z-index: 3;
  pointer-events: none;
}

/* Alternating tape color for variety */
.project-card:nth-child(even)::before {
  background-color: rgba(168, 216, 240, 0.55);
  border-color: rgba(80, 150, 200, 0.30);
  transform: translateX(-40%) rotate(0.8deg);
}

/* Left margin strip — like notebook paper margin */
.project-card__notebook-margin {
  width: 36px;
  flex-shrink: 0;
  background-color: rgba(220, 80, 80, 0.04);
  border-right: 1.5px solid var(--margin-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--sp-10);
  gap: var(--sp-4);
}

.margin-line-number {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.1em;
}

/* Card body */
.project-card__body {
  flex: 1;
  padding: var(--sp-6) var(--sp-5) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  /* Horizontal ruled lines inside the card */
  background-image: linear-gradient(var(--grid-line-h) 1px, transparent 1px);
  background-size: 100% var(--grid-size);
  background-position: 0 calc(var(--grid-size) * 1.5);
}

/* Card header row */
.project-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

/* Category label */
.project-card__category {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

/* Card title */
.project-card__title {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

/* Card description */
.project-card__description {
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  line-height: 1.6;
  flex: 1;
}

/* Tech tags */
.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}
.tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-secondary);
  background-color: var(--paper-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  letter-spacing: 0.03em;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.project-card:hover .tag {
  background-color: var(--paper-shadow);
}

/* Card footer */
.project-card__footer {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border-top: 1px dashed var(--border);
  background-color: rgba(255, 255, 255, 0.50);
}

/* Card meta — likes + bookmark + date on one row */
.project-card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
}

/* Push date to the right */
.project-card__time {
  margin-left: auto;
}

/* Likes button */
.likes-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-secondary);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  transition:
    color            var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    transform        var(--dur-fast) var(--ease-spring);
}
.likes-btn:hover {
  color: var(--badge-zor-ink);
  background-color: var(--accent-red);
  transform: scale(1.08);
}
.likes-btn[aria-pressed="true"] {
  color: #c0392b;
  font-weight: 700;
}
.likes-btn__icon {
  font-size: 1em;
  line-height: 1;
  transition: transform var(--dur-fast) var(--ease-spring);
}
.likes-btn:hover .likes-btn__icon {
  transform: scale(1.25);
}

/* Date */
.project-card__time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}


/* ============================================================
   10. DIFFICULTY BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid;
  position: relative;
  /* Slight hand-drawn tilt on badges */
  transform: rotate(-0.8deg);
  transition: transform var(--dur-fast) var(--ease-spring);
  white-space: nowrap;
  flex-shrink: 0;
}
.project-card:hover .badge {
  transform: rotate(0deg);
}

/* Green — Kolay */
.badge-kolay {
  background-color: var(--badge-kolay-bg);
  color: var(--badge-kolay-ink);
  border-color: var(--badge-kolay-border);
  box-shadow: 1.5px 1.5px 0 var(--badge-kolay-border);
}

/* Orange — Orta */
.badge-orta {
  background-color: var(--badge-orta-bg);
  color: var(--badge-orta-ink);
  border-color: var(--badge-orta-border);
  box-shadow: 1.5px 1.5px 0 var(--badge-orta-border);
  transform: rotate(0.6deg);
}

/* Red — Zor */
.badge-zor {
  background-color: var(--badge-zor-bg);
  color: var(--badge-zor-ink);
  border-color: var(--badge-zor-border);
  box-shadow: 1.5px 1.5px 0 var(--badge-zor-border);
  transform: rotate(-1.1deg);
}


/* ============================================================
   11. NO RESULTS STATE
   ============================================================ */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-20) var(--sp-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}
/* Note: `hidden` attribute hides it — JS removes it */
.no-results[hidden] { display: none; }

.no-results__icon {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  color: var(--ink-faint);
  font-weight: 700;
}
.no-results__message {
  font-size: var(--text-lg);
  color: var(--ink-secondary);
  max-width: 30ch;
}


/* ============================================================
   12. CTA STRIP
   ============================================================ */
.cta-strip {
  background-color: var(--ink);
  color: var(--paper);
  padding-block: var(--sp-12);
  border-top: 3px solid var(--ink);
  position: relative;
  overflow: hidden;
}

/* Graph paper ghost on the dark bg */
.cta-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
}

.cta-strip__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.cta-strip__headline {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--paper);
  margin-bottom: var(--sp-2);
}

.cta-strip__subtext {
  color: rgba(255, 255, 255, 0.60);
  font-size: var(--text-base);
}

/* Override btn--primary for dark bg */
.cta-strip .btn--primary {
  background-color: var(--accent-yellow);
  color: var(--ink);
  border-color: var(--accent-yellow);
  box-shadow: 4px 4px 0 rgba(255,255,255,0.20);
}
.cta-strip .btn--primary:hover {
  background-color: #ffd428;
  border-color: #ffd428;
  box-shadow: 6px 6px 0 rgba(255,255,255,0.30);
}


/* ============================================================
   13. FOOTER
   ============================================================ */
.site-footer {
  background-color: var(--paper-dark);
  border-top: 3px solid var(--ink);
  box-shadow: 0 -2px 0 0 var(--paper-shadow);
  padding-block: var(--sp-10);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-8);
}

/* Brand */
.footer-brand__name {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--sp-1);
}
.footer-brand__tagline {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

/* Footer nav */
.footer-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-1) var(--sp-4);
}
.footer-nav__link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-secondary);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.footer-nav__link:hover {
  color: var(--ink);
  background-color: var(--accent-yellow);
}

/* Copyright */
.footer-copy {
  text-align: right;
}
.footer-copy__text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-secondary);
  margin-bottom: var(--sp-1);
}
.footer-copy__link {
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-copy__link:hover {
  color: var(--ink-secondary);
}
.footer-copy__made-with {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  font-style: italic;
}


/* ============================================================
   14. SCROLLBAR STYLING (Webkit)
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--paper-dark);
}
::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: var(--radius-pill);
  border: 2px solid var(--paper-dark);
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--ink-secondary);
}


/* ============================================================
   15. SELECTION COLOR
   ============================================================ */
::selection {
  background-color: var(--accent-yellow);
  color: var(--ink);
}


/* ============================================================
   16. RESPONSIVE — BREAKPOINTS
   ============================================================ */

/* ─── Large (≤ 1024px) ─── */
@media (max-width: 1024px) {
  :root {
    --grid-size: 24px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
  }
  .hero-notebook-doodle {
    width: 200px;
    aspect-ratio: 3 / 2;
    transform: rotate(1deg);
    margin-inline: auto;
  }
  .hero-section {
    padding-block: var(--sp-12) var(--sp-8);
  }

  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .footer-copy {
    grid-column: 1 / -1;
    text-align: center;
  }
  .footer-nav {
    grid-column: 1 / -1;
    text-align: center;
  }
}

/* ─── Tablet (≤ 768px) ─── */
@media (max-width: 768px) {
  :root {
    --sp-16: 3rem;
    --sp-12: 2.25rem;
    --text-5xl: 2.8rem;
    --text-4xl: 2.2rem;
  }

  .header-nav__list {
    gap: 0;
  }
  .site-logo {
    font-size: var(--text-lg);
  }

  /* Hero */
  .hero-section {
    padding-block: var(--sp-10) var(--sp-6);
  }
  .hero-notebook-doodle {
    display: none; /* hide decorative panel on mobile */
  }
  .hero-subtext {
    font-size: var(--text-base);
    max-width: 100%;
  }

  /* Stats bar */
  .stats-item {
    padding-inline: var(--sp-5);
  }
  .stats-item__value {
    font-size: var(--text-xl);
  }

  /* Filter bar */
  .filter-bar {
    top: var(--header-height, 73px);
    padding-block: var(--sp-4) var(--sp-3);
  }
  .filter-bar__inner {
    gap: var(--sp-3);
  }
  .filter-bar__search {
    margin-left: 0;
    width: 100%;
  }
  .search-input {
    width: 100%;
  }

  /* Cards */
  .cards-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: var(--sp-6);
  }

  /* CTA strip */
  .cta-strip__inner {
    flex-direction: column;
    text-align: center;
    gap: var(--sp-6);
  }

  /* Footer */
  .site-footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--sp-5);
  }
  .footer-copy {
    grid-column: 1;
    text-align: center;
  }
  .footer-brand {
    text-align: center;
  }
}

/* ─── Mobile (≤ 480px) ─── */
@media (max-width: 480px) {
  :root {
    --container-pad: var(--sp-4);
    --grid-size: 20px;
    --text-4xl: 1.9rem;
    --text-3xl: 1.6rem;
  }

  .header-inner {
    justify-content: space-between;
  }

  /* Hero */
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-section {
    padding-block: var(--sp-8) var(--sp-4);
  }

  /* Stats: stack vertically */
  .stats-list {
    flex-direction: column;
    gap: var(--sp-3);
  }
  .stats-item--divider {
    width: 60px;
    height: 1px;
  }
  .stats-item {
    padding-inline: 0;
  }
  .stats-bar__inner {
    padding-block: var(--sp-6);
  }

  /* Filter bar: scroll horizontally */
  .filter-bar__inner {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--sp-2);
    -webkit-overflow-scrolling: touch;
  }
  .filter-list {
    flex-wrap: nowrap;
  }
  .filter-bar__search {
    min-width: 180px;
  }
  .filter-bar__label {
    display: none;
  }

  /* Cards: single column */
  .cards-wrapper {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  /* Cards: reduce rotation on tiny screens for readability */
  .project-card,
  .project-card:nth-child(1),
  .project-card:nth-child(2),
  .project-card:nth-child(3),
  .project-card:nth-child(4) {
    --card-rotate: 0deg;
  }

  /* Footer */
  .footer-nav__list {
    gap: var(--sp-1) var(--sp-2);
  }
}


/* ============================================================
   17. PRINT STYLES
   ============================================================ */
@media print {
  body {
    background-image: none;
    background-color: #fff;
  }
  .site-header,
  .filter-bar,
  .cta-strip,
  .hero-notebook-doodle,
  .stats-bar {
    display: none;
  }
  .project-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
    transform: none !important;
  }
  .project-card::before { display: none; }
  .cards-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}


/* ============================================================
   18. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .logo-cursor {
    animation: none;
    opacity: 1;
  }
  html {
    scroll-behavior: auto;
  }
}
/* ============================================================
   ELEKTRODEFTER — project-detail additions
   Append these rules to the bottom of style.css
   ============================================================ */


/* ============================================================
   BREADCRUMB
   ============================================================ */
.detail-breadcrumb {
  padding-block: var(--sp-5) var(--sp-3);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  list-style: none;
}

.breadcrumb-link {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--paper-dark);
  box-shadow: 2px 2px 0 var(--border);
  transition:
    background-color var(--dur-base) var(--ease-out),
    box-shadow       var(--dur-base) var(--ease-out),
    transform        var(--dur-fast) var(--ease-spring);
}
.breadcrumb-link:hover {
  background-color: var(--accent-yellow);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--border-strong);
  transform: translate(-1px, -1px);
}
.breadcrumb-link:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--border);
}

.breadcrumb-item--sep {
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: var(--text-sm);
  user-select: none;
}

.breadcrumb-item--current {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink);
  font-weight: 500;
  /* Truncate long titles on mobile */
  max-width: 32ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ============================================================
   LOADING SKELETON
   ============================================================ */
.detail-skeleton {
  padding-block: var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton-line {
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--paper-shadow) 25%,
    var(--paper-dark)   50%,
    var(--paper-shadow) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
}
.skeleton-line--title  { height: 42px; width: 60%; }
.skeleton-line--meta   { height: 20px; width: 38%; }
.skeleton-line--body   { height: 16px; width: 90%; }
.skeleton-line--short  { width: 55%; }


/* ============================================================
   PROJECT DETAIL — layout wrapper
   ============================================================ */
.project-detail {
  padding-block: var(--sp-4) var(--sp-20);
}

.detail-article {
  display: flex;
  flex-direction: column;
  gap: 0;
}


/* ============================================================
   DETAIL HEADER
   ============================================================ */
.detail-header {
  padding-block: var(--sp-6) var(--sp-8);
}

.detail-header__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

/* Tilt badge back to straight on the detail page */
.detail-badge-wrap .badge {
  transform: rotate(0deg);
}

.detail-header__category {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-secondary);
}

.detail-header__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  margin-left: auto;
}

/* Main title */
.detail-title {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: var(--sp-4);
  /* Yellow highlighter slab behind the title */
  position: relative;
  display: inline-block;
}
.detail-title::after {
  content: '';
  position: absolute;
  bottom: 6px; left: -4px;
  width: calc(100% + 8px);
  height: 0.35em;
  background-color: var(--accent-yellow);
  z-index: -1;
  transform: rotate(-0.5deg) skewX(-2deg);
  opacity: 0.65;
}

.detail-description {
  font-size: var(--text-lg);
  color: var(--ink-secondary);
  line-height: 1.75;
  max-width: 72ch;
  margin-bottom: var(--sp-6);
}

/* Author + likes row */
.detail-header__author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.detail-author {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.detail-author__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--border-strong);
  letter-spacing: 0.05em;
}

.detail-author__name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
}

/* Detail likes button — larger than card version */
.detail-likes-btn {
  font-size: var(--text-base);
  padding: var(--sp-2) var(--sp-5);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background-color: var(--paper-dark);
  gap: var(--sp-2);
  box-shadow: 2px 2px 0 var(--border);
  transition:
    background-color var(--dur-base) var(--ease-out),
    border-color     var(--dur-base) var(--ease-out),
    box-shadow       var(--dur-base) var(--ease-out),
    transform        var(--dur-fast) var(--ease-spring);
}
.detail-likes-btn:hover {
  background-color: var(--accent-red);
  border-color: var(--badge-zor-border);
  box-shadow: 3px 3px 0 var(--badge-zor-border);
  transform: translate(-1px, -1px);
}
.detail-likes-btn.likes-btn--liked {
  background-color: var(--accent-red);
  border-color: var(--badge-zor-border);
  color: var(--badge-zor-ink);
  font-weight: 600;
}
.detail-likes-btn__label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
}


/* ============================================================
   SECTION DIVIDER — hand-drawn rule
   ============================================================ */
.detail-rule {
  border: none;
  /* Simulated wavy ink line using a repeating gradient */
  height: 4px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--ink) 0px,
      var(--ink) 12px,
      transparent 12px,
      transparent 14px
    );
  margin-block: var(--sp-4) var(--sp-2);
  opacity: 0.18;
  border-radius: 2px;
}


/* ============================================================
   DETAIL SECTIONS — shared layout
   ============================================================ */
.detail-section {
  padding-block: var(--sp-10) var(--sp-6);
  border-bottom: 1px dashed var(--border);
}
.detail-section:last-child {
  border-bottom: none;
}

.detail-section__heading-wrap {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.detail-section__heading {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
}

.detail-section__number {
  font-size: var(--text-sm);
  color: var(--ink-faint);
  font-weight: 400;
  letter-spacing: 0.06em;
}

.detail-section__hint {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-style: italic;
  margin-left: auto;
}


/* ============================================================
   MATERIALS CHECKLIST — handwritten notebook style
   ============================================================ */
.materials-checklist {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: var(--sp-2) var(--sp-6);
  /* Notebook ruled-line background inside the list */
  background-image: linear-gradient(var(--grid-line-h) 1px, transparent 1px);
  background-size: 100% calc(var(--grid-size) * 1.6);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border-left: 3px solid var(--margin-line);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: calc(var(--grid-size) * 1.6);
  position: relative;
}

/* Hide the native checkbox */
.checklist-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Custom checkbox — hand-drawn square */
.checklist-label {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  width: 100%;
  padding: var(--sp-1) 0;
  user-select: none;
  transition: opacity var(--dur-base) var(--ease-out);
}

/* The box itself */
.checklist-label::before {
  content: '';
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink-secondary);
  border-radius: 3px;
  background-color: transparent;
  /* Slight hand-drawn feel: uneven border via box-shadow */
  box-shadow: 1px 1px 0 rgba(0,0,0,0.10), inset 0 0 0 1px rgba(255,255,255,0.4);
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color     var(--dur-fast) var(--ease-out),
    transform        var(--dur-fast) var(--ease-spring);
  transform: rotate(-0.8deg);
}

/* Checkmark — drawn as a CSS clip-path tick */
.checklist-label::after {
  content: '';
  position: absolute;
  left: 3px; top: 50%;
  width: 12px; height: 7px;
  border-left: 2.5px solid var(--badge-kolay-ink);
  border-bottom: 2.5px solid var(--badge-kolay-ink);
  transform: translateY(-65%) rotate(-45deg) scale(0);
  transform-origin: left bottom;
  transition: transform var(--dur-base) var(--ease-spring);
}

/* Checked state */
.checklist-checkbox:checked + .checklist-label::before {
  background-color: var(--badge-kolay-bg);
  border-color: var(--badge-kolay-border);
  transform: rotate(0deg);
}
.checklist-checkbox:checked + .checklist-label::after {
  transform: translateY(-65%) rotate(-45deg) scale(1);
}
.checklist-checkbox:checked + .checklist-label {
  opacity: 0.55;
}
.checklist-checkbox:checked + .checklist-label .checklist-name {
  text-decoration: line-through;
  text-decoration-color: var(--ink-secondary);
}

/* Focus ring on label (keyboard) */
.checklist-checkbox:focus-visible + .checklist-label::before {
  outline: 2.5px dashed var(--ink);
  outline-offset: 2px;
}

/* Text parts */
.checklist-qty {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-muted);
  min-width: 2.4ch;
  letter-spacing: 0.04em;
}

.checklist-name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--ink);
  line-height: 1.4;
  transition: color var(--dur-fast) var(--ease-out);
}
.checklist-label:hover .checklist-name {
  color: var(--ink);
}
.checklist-label:hover::before {
  border-color: var(--ink);
  transform: rotate(0deg) scale(1.08);
}


/* ============================================================
   STEPS LIST — tappable step cards
   ============================================================ */
.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  counter-reset: steps-counter;
}

.step-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  background-color: rgba(255, 255, 255, 0.6);
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  overflow: hidden;
  cursor: pointer;
  transition:
    border-left-color var(--dur-base) var(--ease-out),
    background-color  var(--dur-base) var(--ease-out),
    transform         var(--dur-fast) var(--ease-spring),
    box-shadow        var(--dur-base) var(--ease-out);
}
.step-item:hover {
  border-left-color: var(--ink);
  background-color: var(--paper);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}
.step-item:focus-visible {
  outline: 2.5px dashed var(--ink);
  outline-offset: 3px;
}

/* Done state */
.step-item--done {
  border-left-color: var(--badge-kolay-border) !important;
  background-color: rgba(200, 245, 216, 0.25) !important;
}
.step-item--done .step-item__title {
  text-decoration: line-through;
  text-decoration-color: var(--ink-muted);
  color: var(--ink-secondary);
}
.step-item--done .step-item__number {
  color: var(--badge-kolay-ink);
}
.step-item--done .step-item__done-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Step header */
.step-item__header {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
}

.step-item__number {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink-faint);
  min-width: 2ch;
  letter-spacing: 0.04em;
  transition: color var(--dur-base) var(--ease-out);
  flex-shrink: 0;
}

.step-item__title {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  transition: color var(--dur-base) var(--ease-out);
}

/* Checkmark icon — hidden until done */
.step-item__done-icon {
  font-size: var(--text-base);
  color: var(--badge-kolay-ink);
  opacity: 0;
  transform: scale(0.4) rotate(-30deg);
  transition:
    opacity   var(--dur-base) var(--ease-spring),
    transform var(--dur-base) var(--ease-spring);
  flex-shrink: 0;
}

/* Detail paragraph */
.step-item__detail {
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  line-height: 1.7;
  padding: 0 var(--sp-5) var(--sp-4) calc(var(--sp-5) + 2ch + var(--sp-4));
  border-top: 1px dashed var(--border);
  padding-top: var(--sp-3);
}


/* ============================================================
   CODE BLOCK — dark terminal taped onto the notebook
   ============================================================ */
.detail-section--code {
  width: 100%;
}

.code-block-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  /* Tape effect — angled strip at top */
  margin-top: var(--sp-2);
  box-shadow:
    5px 8px 24px rgba(20, 15, 5, 0.32),
    0 2px 4px rgba(20, 15, 5, 0.20);
  /* Very slight rotation: dark paper tossed onto notebook */
  transform: rotate(-0.25deg);
  transition: transform var(--dur-slow) var(--ease-spring),
              box-shadow var(--dur-slow) var(--ease-out);
}
.code-block-wrapper:hover {
  transform: rotate(0deg);
  box-shadow:
    8px 14px 36px rgba(20, 15, 5, 0.36),
    0 3px 8px rgba(20, 15, 5, 0.22);
}

/* Tape strip across the top of the code block */
.code-block-wrapper::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 48px;
  width: 80px;
  height: 22px;
  background-color: rgba(255, 224, 102, 0.55);
  border: 1px solid rgba(200, 170, 60, 0.35);
  border-radius: 2px;
  z-index: 4;
  transform: rotate(-1.2deg);
  pointer-events: none;
}

/* ── Terminal toolbar ── */
.code-block-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background-color: #1a1c23;
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  user-select: none;
}

/* Traffic-light dots */
.code-block-toolbar__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.code-block-toolbar__dot--red    { background-color: #ff5f57; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }
.code-block-toolbar__dot--yellow { background-color: #febc2e; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }
.code-block-toolbar__dot--green  { background-color: #28c840; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }

.code-block-toolbar__filename {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.45);
  margin-left: var(--sp-3);
  letter-spacing: 0.04em;
  flex: 1;
}

/* Copy button */
.code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 3px 10px;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    color            var(--dur-fast) var(--ease-out),
    border-color     var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}
.code-copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.90);
  border-color: rgba(255, 255, 255, 0.35);
}
.code-copy-btn--success {
  color: #28c840 !important;
  border-color: rgba(40, 200, 64, 0.55) !important;
}

.code-copy-btn__icon {
  font-size: 1.1em;
  line-height: 1;
}

/* ── The <pre> code block itself ── */
.code-block {
  margin: 0;
  padding: var(--sp-6) var(--sp-6) var(--sp-8);
  background-color: #1e2030;
  /* Subtle scanline texture for depth */
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.08) 0px,
    rgba(0, 0, 0, 0.08) 1px,
    transparent 1px,
    transparent 3px
  );
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Custom scrollbar inside code block */
  scrollbar-width: thin;
  scrollbar-color: #3a3d52 #1e2030;
}
.code-block::-webkit-scrollbar        { height: 6px; }
.code-block::-webkit-scrollbar-track  { background: #1e2030; }
.code-block::-webkit-scrollbar-thumb  { background-color: #3a3d52; border-radius: 3px; }

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.75;
  color: #cdd6f4;         /* Catppuccin Mocha text */
  white-space: pre;
  display: block;
  tab-size: 2;
  /* Minimal syntax colouring via CSS — comment lines */
}

/* Colour comment lines (lines starting with //) using a clean trick */
.code-block code::before {
  /* No global pseudo — handled per-line in JS if needed */
  content: none;
}

/* Inline token colours using CSS text-emphasis hack isn't possible
   without a highlighter lib, so we use a clean monochrome-warm scheme
   that still reads as code. Real highlighting = add Prism.js later. */


/* ============================================================
   NOT-FOUND STATE
   ============================================================ */
.detail-not-found {
  text-align: center;
  padding: var(--sp-24) var(--sp-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
}

.detail-not-found__code {
  font-family: var(--font-mono);
  font-size: clamp(var(--text-3xl), 8vw, var(--text-5xl));
  font-weight: 700;
  color: var(--ink-faint);
  letter-spacing: -0.04em;
}

.detail-not-found__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--ink);
}

.detail-not-found__message {
  font-size: var(--text-base);
  color: var(--ink-secondary);
  max-width: 36ch;
}


/* ============================================================
   RESPONSIVE — detail page overrides
   ============================================================ */
@media (max-width: 768px) {
  .detail-title {
    font-size: var(--text-2xl);
  }
  .detail-description {
    font-size: var(--text-base);
  }
  .detail-header__date {
    margin-left: 0;
  }

  .materials-checklist {
    grid-template-columns: 1fr;
  }

  .step-item__detail {
    padding-left: var(--sp-5);
  }

  .code-block-wrapper {
    transform: rotate(0deg); /* disable tilt on small screens */
    border-radius: var(--radius-sm);
  }
  .code-block {
    padding: var(--sp-4);
  }
  .code-block code {
    font-size: 0.75rem;
  }

  .detail-section__hint {
    display: none; /* too cluttered on narrow screens */
  }

  .detail-header__author-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
  }
}

@media (max-width: 480px) {
  .breadcrumb-item--current {
    max-width: 18ch;
  }

  .detail-section__heading {
    font-size: var(--text-lg);
  }

  .step-item__header {
    padding: var(--sp-3) var(--sp-4);
  }

  .code-block-toolbar {
    padding: var(--sp-2) var(--sp-3);
  }
  .code-copy-btn__label {
    display: none; /* icon only on very small screens */
  }
}
/* ============================================================
   ELEKTRODEFTER — Mobile & Tablet Responsive Overrides
   Append to the very bottom of style.css
   Breakpoints:
     768px  — tablets & large phones (landscape + portrait)
     480px  — phones (portrait)
     360px  — small phones (Galaxy S series, older iPhones)
   ============================================================ */


/* ============================================================
   @media (max-width: 768px)
   Tablets · Phones in landscape · Large phones
   ============================================================ */
@media (max-width: 768px) {

  /* ── Root token overrides ──────────────────────────────── */
  :root {
    --container-pad : var(--sp-4);   /* tighter side gutters */
    --grid-size     : 22px;          /* smaller graph paper grid */
    --sp-16         : 3rem;
    --sp-20         : 4rem;
    --sp-24         : 5rem;
  }


  /* ── Site header ──────────────────────────────────────── */
  .header-inner {
    flex-wrap   : wrap;
    gap         : var(--sp-2);
    padding-block: var(--sp-3);
    /* Logo left · CTA right · nav underneath */
  }

  .header-nav {
    order      : 3;           /* push below logo row */
    width      : 100%;
    justify-content: flex-start;
    border-top : 1px dashed var(--border);
    padding-top: var(--sp-2);
    overflow-x : auto;        /* allow horizontal scroll if many links */
    -webkit-overflow-scrolling: touch;
  }

  .header-nav__list {
    gap        : 0;
    flex-wrap  : nowrap;
    min-width  : max-content; /* prevent wrapping — scroll instead */
  }

  .header-nav__link {
    font-size  : var(--text-xs);
    padding    : var(--sp-2) var(--sp-2);
  }

  .site-logo {
    font-size  : var(--text-base);
  }

  .btn--add-project .btn__label {
    font-size  : var(--text-xs);
  }


  /* ── Hero section ─────────────────────────────────────── */
  .hero-section {
    padding-block: var(--sp-10) var(--sp-6);
  }

  .hero-inner {
    grid-template-columns: 1fr;   /* single column */
    gap: var(--sp-6);
  }

  .hero-headline {
    font-size: clamp(var(--text-2xl), 7vw, var(--text-3xl));
  }

  .hero-subtext {
    font-size : var(--text-base);
    max-width : 100%;
  }

  .hero-actions {
    flex-direction : row;    /* keep buttons side-by-side while space allows */
    flex-wrap      : wrap;
    gap            : var(--sp-2);
  }

  .hero-notebook-doodle {
    display: none;           /* decorative — hide to reclaim vertical space */
  }

  .hero-eyebrow {
    font-size: var(--text-xs);
  }


  /* ── Stats bar ────────────────────────────────────────── */
  .stats-list {
    gap: var(--sp-2);
  }

  .stats-item {
    padding-inline: var(--sp-5);
  }

  .stats-item__value {
    font-size: var(--text-xl);
  }

  .stats-item__label {
    font-size: 0.65rem;
  }


  /* ── Filter bar ───────────────────────────────────────── */
  .filter-bar {
    top            : 105px;         /* adjust for taller 2-row header */
    padding-block  : var(--sp-3) var(--sp-3);
  }

  .filter-bar__inner {
    flex-wrap      : nowrap;        /* single scrollable row */
    gap            : var(--sp-2);
    overflow-x     : auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom : var(--sp-2);   /* room for the scrollbar */
    /* Fade-out right edge to hint scrollability */
    -webkit-mask-image : linear-gradient(
      to right, black 85%, transparent 100%
    );
    mask-image : linear-gradient(
      to right, black 85%, transparent 100%
    );
  }

  .filter-bar__label {
    display    : none;  /* "Filtrele:" label — remove to save space */
  }

  .filter-list {
    flex-wrap  : nowrap;
    gap        : var(--sp-2);
    min-width  : max-content;
  }

  .filter-btn {
    font-size  : var(--text-xs);
    padding    : var(--sp-2) var(--sp-3);
    white-space: nowrap;
  }

  .filter-bar__search {
    margin-left : 0;
    flex-shrink : 0;
    min-width   : 160px;
  }

  .search-input {
    width      : 160px;
    font-size  : var(--text-xs);
    padding    : var(--sp-2) var(--sp-3);
  }


  /* ── Projects grid ────────────────────────────────────── */
  .projects-grid {
    padding-block: var(--sp-6) var(--sp-10);
  }

  .projects-grid__header {
    margin-bottom: var(--sp-5);
    flex-wrap    : wrap;
    gap          : var(--sp-2);
  }

  .projects-grid__title {
    font-size: var(--text-lg);
  }

  /* 2-column grid on tablets, falls to 1 on smaller phones */
  .cards-wrapper {
    grid-template-columns: repeat(
      auto-fill,
      minmax(min(100%, 260px), 1fr)
    );
    gap: var(--sp-6);
  }

  /* Reduce card tape offset so it doesn't clip */
  .project-card::before {
    top  : -8px;
    width: 52px;
    height: 18px;
  }

  .project-card__body {
    padding: var(--sp-4) var(--sp-4) var(--sp-3);
  }

  .project-card__footer {
    padding: var(--sp-3) var(--sp-4);
  }

  .project-card__description {
    font-size  : var(--text-sm);
    /* Limit description to 3 lines on card grid */
    display            : -webkit-box;
    -webkit-line-clamp : 3;
    line-clamp         : 3;
    -webkit-box-orient : vertical;
    overflow           : hidden;
  }


  /* ── CTA strip ────────────────────────────────────────── */
  .cta-strip {
    padding-block: var(--sp-10);
  }

  .cta-strip__inner {
    flex-direction : column;
    text-align     : center;
    gap            : var(--sp-5);
    align-items    : center;
  }

  .cta-strip__headline {
    font-size: var(--text-xl);
  }

  .cta-strip__subtext {
    font-size: var(--text-sm);
  }


  /* ── Footer ───────────────────────────────────────────── */
  .site-footer__inner {
    grid-template-columns : 1fr;
    gap                   : var(--sp-5);
    text-align            : center;
  }

  .footer-brand {
    text-align: center;
  }

  .footer-nav {
    grid-column: 1;
  }

  .footer-nav__list {
    justify-content : center;
    gap             : var(--sp-1) var(--sp-3);
  }

  .footer-copy {
    grid-column : 1;
    text-align  : center;
  }


  /* ── PROJECT DETAIL page ─────────────────────────────── */

  /* Breadcrumb */
  .detail-breadcrumb {
    padding-block: var(--sp-3) var(--sp-2);
  }

  .breadcrumb-item--current {
    max-width  : 22ch;
    font-size  : var(--text-xs);
  }

  /* Detail header */
  .detail-header {
    padding-block: var(--sp-4) var(--sp-6);
  }

  .detail-title {
    font-size     : clamp(var(--text-xl), 6vw, var(--text-2xl));
    margin-bottom : var(--sp-3);
    display       : block;  /* let ::after flow naturally */
  }

  .detail-description {
    font-size  : var(--text-base);
    max-width  : 100%;
    margin-bottom: var(--sp-4);
  }

  .detail-header__meta {
    gap: var(--sp-2);
  }

  .detail-header__date {
    margin-left : 0;        /* break out of auto-margin for wrapping */
    width       : 100%;
  }

  .detail-header__author-row {
    flex-direction : column;
    align-items    : flex-start;
    gap            : var(--sp-3);
  }

  /* Section headings */
  .detail-section {
    padding-block: var(--sp-8) var(--sp-5);
  }

  .detail-section__heading {
    font-size: var(--text-lg);
  }

  .detail-section__number {
    font-size: var(--text-xs);
  }

  .detail-section__hint {
    display: none;          /* hide inline hints — too noisy on mobile */
  }

  .detail-section__heading-wrap {
    margin-bottom: var(--sp-4);
  }

  /* Materials checklist */
  .materials-checklist {
    grid-template-columns : 1fr;   /* single column on mobile */
    padding               : var(--sp-2) var(--sp-3) var(--sp-3);
    gap                   : var(--sp-1);
  }

  .checklist-name {
    font-size: var(--text-sm);
  }

  /* Steps */
  .step-item__header {
    padding: var(--sp-3) var(--sp-4);
    gap    : var(--sp-3);
  }

  .step-item__title {
    font-size: var(--text-sm);
  }

  .step-item__detail {
    font-size    : var(--text-sm);
    padding-left : var(--sp-4);   /* remove deep indent on mobile */
    padding-right: var(--sp-4);
  }

  .step-item:hover {
    transform: none;        /* disable slide on touch devices */
  }

  /* Code block — CRITICAL: prevent horizontal page overflow */
  .code-block-wrapper {
    transform     : rotate(0deg);  /* remove tilt — causes overflow on mobile */
    border-radius : var(--radius-sm);
    margin-top    : var(--sp-2);
  }

  .code-block-wrapper::before {
    display: none;          /* hide tape decoration on mobile */
  }

  .code-block-toolbar {
    padding: var(--sp-2) var(--sp-3);
    gap    : var(--sp-2);
  }

  .code-block-toolbar__filename {
    font-size    : 0.68rem;
    /* Truncate long filenames */
    overflow     : hidden;
    text-overflow: ellipsis;
    white-space  : nowrap;
    max-width    : 14ch;
  }

  .code-copy-btn {
    padding: 3px 8px;
  }

  .code-copy-btn__label {
    display: none;          /* icon-only on mobile to save toolbar space */
  }

  /*
   * The single most important mobile rule:
   * <pre> must NOT expand the page width.
   * overflow-x: auto creates an inner scrollable zone.
   * max-width + width: 100% confine it to the viewport.
   */
  .code-block {
    padding   : var(--sp-4);
    overflow-x: auto;
    max-width : 100%;
    width     : 100%;
    -webkit-overflow-scrolling: touch;
    /* Prevent text from wrapping so scroll works correctly */
    white-space: pre;
  }

  .code-block code {
    font-size  : 0.73rem;
    line-height: 1.65;
    white-space: pre;   /* keep — do NOT set pre-wrap on mobile */
    word-break : normal;
    overflow-wrap: normal;
  }

  /* Not-found state */
  .detail-not-found {
    padding: var(--sp-16) var(--sp-4);
    gap    : var(--sp-4);
  }
}


/* ============================================================
   @media (max-width: 480px)
   Phones — portrait (iPhone SE, Galaxy S series)
   ============================================================ */
@media (max-width: 480px) {

  /* ── Root tokens ──────────────────────────────────────── */
  :root {
    --container-pad: var(--sp-3);
    --grid-size    : 18px;
    --text-5xl     : 2.4rem;
    --text-4xl     : 2rem;
    --text-3xl     : 1.7rem;
    --text-2xl     : 1.4rem;
  }


  /* ── Header: logo + CTA only; hide nav ────────────────── */
  .header-nav {
    display: none;           /* replaced by a hamburger menu in v2 */
  }

  .header-inner {
    justify-content: space-between;
    align-items    : center;
  }

  .site-logo {
    font-size: var(--text-sm);
  }

  .btn--add-project {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--text-xs);
  }


  /* ── Hero ─────────────────────────────────────────────── */
  .hero-section {
    padding-block: var(--sp-8) var(--sp-4);
  }

  .hero-eyebrow {
    display: none;          /* code comment eyebrow — remove on tiny screens */
  }

  .hero-headline {
    font-size     : clamp(1.6rem, 8vw, 2rem);
    margin-bottom : var(--sp-3);
  }

  .hero-headline__accent::after {
    height: 0.4em;
  }

  .hero-subtext {
    font-size    : var(--text-sm);
    line-height  : 1.65;
    margin-bottom: var(--sp-5);
  }

  .hero-actions {
    flex-direction: column;
    align-items   : flex-start;
    gap           : var(--sp-2);
  }

  .hero-actions .btn {
    width    : 100%;
    justify-content: center;
  }


  /* ── Stats bar ────────────────────────────────────────── */
  .stats-bar__inner {
    padding-block: var(--sp-5);
  }

  .stats-list {
    flex-direction : row;
    justify-content: space-around;
    flex-wrap      : nowrap;
    gap            : 0;
  }

  .stats-item {
    padding-inline : 0;
    flex: 1;
    align-items    : center;
  }

  .stats-item--divider {
    width  : 1px;
    height : 32px;
    flex   : none;
    padding: 0;
    background: rgba(255,255,255,0.15);
  }

  .stats-item__value {
    font-size: var(--text-lg);
  }

  .stats-item__label {
    font-size: 0.6rem;
    text-align: center;
  }


  /* ── Filter bar ───────────────────────────────────────── */
  .filter-bar {
    top           : 65px;   /* single-row header on phones */
    padding-block : var(--sp-2);
  }

  .filter-bar__inner {
    gap: var(--sp-2);
  }

  .filter-btn {
    padding   : var(--sp-1) var(--sp-3);
    font-size : 0.68rem;
  }

  /* Hide search field — too cramped; could become a modal in v2 */
  .filter-bar__search {
    display: none;
  }


  /* ── Cards grid — single column ──────────────────────── */
  .cards-wrapper {
    grid-template-columns : 1fr;
    gap                   : var(--sp-5);
  }

  /* Remove all card tilts on tiny screens — readability first */
  .project-card,
  .project-card:nth-child(1),
  .project-card:nth-child(2),
  .project-card:nth-child(3),
  .project-card:nth-child(4) {
    --card-rotate: 0deg;
    transform    : none;
  }

  .project-card:hover {
    transform: translateY(-3px);
  }

  .project-card__title {
    font-size: var(--text-base);
  }

  .project-card__description {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .project-card__footer {
    flex-direction: column;
    align-items   : flex-start;
    gap           : var(--sp-2);
  }

  .btn--inspect {
    width          : 100%;
    justify-content: center;
  }

  .project-card__meta {
    width: 100%;
    justify-content: space-between;
  }

  /* Cards grid header */
  .projects-grid__title::before {
    content: '';  /* remove "// " prefix — saves space */
  }


  /* ── No-results ───────────────────────────────────────── */
  .no-results {
    padding: var(--sp-12) var(--sp-4);
  }

  .no-results__icon {
    font-size: var(--text-2xl);
  }


  /* ── CTA strip ────────────────────────────────────────── */
  .cta-strip__btn {
    width          : 100%;
    justify-content: center;
  }


  /* ── Footer ───────────────────────────────────────────── */
  .footer-nav__list {
    gap: var(--sp-1) var(--sp-2);
  }

  .footer-nav__link {
    font-size: 0.68rem;
  }


  /* ── PROJECT DETAIL overrides ────────────────────────── */

  .detail-breadcrumb {
    padding-block: var(--sp-2);
  }

  .breadcrumb-link {
    font-size: 0.68rem;
    padding  : 3px var(--sp-2);
  }

  .breadcrumb-item--current {
    max-width: 14ch;
    font-size: 0.68rem;
  }

  .detail-title {
    font-size: clamp(1.4rem, 7vw, 1.8rem);
  }

  .detail-author__avatar {
    width : 32px;
    height: 32px;
    font-size: 0.65rem;
  }

  .detail-likes-btn {
    font-size : var(--text-sm);
    padding   : var(--sp-1) var(--sp-4);
  }

  .detail-likes-btn__label {
    display: none;          /* icon + count is enough on small screens */
  }

  .materials-checklist {
    padding: var(--sp-2) var(--sp-2) var(--sp-2);
  }

  .checklist-label::before {
    width : 16px;
    height: 16px;
  }

  .code-block {
    padding: var(--sp-3);
  }

  .code-block code {
    font-size  : 0.68rem;
    line-height: 1.6;
  }

  .detail-not-found__code {
    font-size: clamp(2rem, 12vw, 3rem);
  }
}


/* ============================================================
   @media (max-width: 360px)
   Very small phones — Galaxy S5, older budget Androids
   ============================================================ */
@media (max-width: 360px) {

  :root {
    --container-pad: var(--sp-3);
  }

  .site-logo .logo-bracket {
    display: none;    /* [ElektroDefter] → ElektroDefter_ only */
  }

  .hero-headline {
    font-size: 1.5rem;
  }

  .stats-item__value {
    font-size: var(--text-base);
  }

  .filter-btn {
    font-size: 0.65rem;
    padding  : 5px var(--sp-2);
  }

  .code-block code {
    font-size: 0.64rem;
  }

  .project-card__body {
    padding: var(--sp-3);
  }

  .project-card__footer {
    padding: var(--sp-2) var(--sp-3);
  }
}


/* ============================================================
   TOUCH DEVICE UTILITIES
   Remove hover effects that feel broken on touch screens
   ============================================================ */
@media (hover: none) and (pointer: coarse) {

  /* Disable transforms that require precise hover */
  .filter-btn:hover {
    transform: none;
  }

  .btn--primary:hover,
  .btn--secondary:hover {
    transform : none;
    box-shadow: 3px 3px 0 var(--border-strong);
  }

  .btn--inspect:hover {
    transform : none;
    box-shadow: 2px 2px 0 var(--ink-secondary);
  }

  .project-card:hover {
    transform : none;
    box-shadow: var(--shadow-card);
  }

  .breadcrumb-link:hover {
    transform: none;
  }

  /* Increase tap target sizes to minimum 44×44px */
  .filter-btn {
    min-height: 44px;
    min-width : 44px;
  }

  .likes-btn {
    min-height: 44px;
    padding   : var(--sp-2) var(--sp-3);
  }

  .btn {
    min-height: 44px;
  }

  .checklist-label {
    min-height: 44px;
    align-items: center;
  }

  .step-item:hover {
    transform   : none;
    box-shadow  : none;
    border-left-color: var(--border-strong);
  }

  /* Enlarge the code copy button tap area */
  .code-copy-btn {
    padding   : var(--sp-2) var(--sp-3);
    min-height: 36px;
  }
}
/* --- MASAÜSTÜ KART VE BUTON DÜZELTMELERİ --- */

/* 1. Bütün kartları aynı yüksekliğe zorla */
#projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    align-items: stretch !important; /* En uzun kart hangisiyse, diğerlerini de o boya uzatır */
}

/* 2. Kartın iç düzenini yukarıdan aşağıya (Flex) ayarla */
.project-card {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    height: 100%; /* Grid hücresini tam doldurması için */
    overflow: hidden; /* Kenardan taşan hatalı tasarımları gizle */
}

/* 3. İçerik kısmını esnet ki buton hep en altta kalsın */
.project-card > *:not(button):not(a.btn) {
    /* Kartın içindeki buton HARİÇ her şeyi kapsar */
    flex-shrink: 0;
}

/* 4. Yarım kesilen butonları kartın altına, tam genişlikte oturt */
.project-card button,
.project-card a,
.project-card .btn {
    position: static !important; /* Sağa sola yapışmasını iptal et */
    display: block !important;
    width: 100% !important;
    margin-top: auto !important; /* Butonu zorla en alta iter */
    padding: 12px !important;
    text-align: center !important;
    background-color: #2c3e50 !important; /* Koyu lacivert buton rengi */
    color: white !important;
    border-radius: 4px !important;
    transform: none !important;
    right: auto !important;
}
/* ============================================================
   ElektroDefter — add-project.css
   Lab Report / Technical Spec Sheet form styles
   Link AFTER style.css in add-project.html
   ============================================================ */


/* ============================================================
   PAGE HEADER — lab report cover sheet
   ============================================================ */
.form-page-header {
  padding-block: var(--sp-8) 0;
}

.form-page-header__inner {
  display       : flex;
  align-items   : flex-start;
  gap           : var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom : 2px solid var(--ink);
  position      : relative;
}

/* Stamp */
.form-page-header__stamp {
  flex-shrink    : 0;
  width          : 72px;
  height         : 72px;
  border         : 3px solid var(--ink);
  border-radius  : var(--radius-sm);
  display        : flex;
  flex-direction : column;
  align-items    : center;
  justify-content: center;
  transform      : rotate(-4deg);
  background     : var(--paper);
  box-shadow     : 2px 2px 0 var(--border-strong);
  line-height    : 1;
  gap            : 2px;
  margin-top     : var(--sp-2);
}
.stamp-text {
  font-family : var(--font-mono);
  font-size   : var(--text-xs);
  font-weight : 700;
  color       : var(--badge-kolay-ink);
  letter-spacing: 0.1em;
}
.stamp-sub {
  font-family : var(--font-mono);
  font-size   : 0.6rem;
  color       : var(--ink-muted);
  letter-spacing: 0.06em;
}

.form-page-header__eyebrow {
  font-family : var(--font-mono);
  font-size   : var(--text-xs);
  color       : var(--ink-muted);
  margin-bottom: var(--sp-2);
}

.form-page-header__title {
  font-size    : clamp(var(--text-xl), 4vw, var(--text-3xl));
  font-weight  : 700;
  color        : var(--ink);
  margin-bottom: var(--sp-2);
  letter-spacing: -0.03em;
}

.form-page-header__sub {
  font-size : var(--text-base);
  color     : var(--ink-secondary);
  max-width : 58ch;
  line-height: 1.65;
}

/* Meta strip — report number, date, status */
.form-meta-strip {
  display       : flex;
  flex-wrap     : wrap;
  gap           : 0;
  background    : var(--paper-dark);
  border        : 1.5px solid var(--border);
  border-top    : none;
  border-radius : 0 0 var(--radius-sm) var(--radius-sm);
}

.form-meta-strip__item {
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-1);
  padding       : var(--sp-3) var(--sp-6);
  border-right  : 1.5px solid var(--border);
  flex          : 1;
  min-width     : 120px;
}
.form-meta-strip__item:last-child {
  border-right: none;
}

.form-meta-strip dt {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-meta-strip dd {
  font-family : var(--font-mono);
  font-size   : var(--text-sm);
  font-weight : 600;
  color       : var(--ink);
}

.form-meta-strip__status {
  color: var(--ink-secondary) !important;
}
.form-meta-strip__status--editing {
  color: var(--badge-orta-ink) !important;
}
.form-meta-strip__status--saved {
  color: var(--badge-kolay-ink) !important;
}


/* ============================================================
   FORM LAYOUT
   ============================================================ */
.form-main {
  padding-block: var(--sp-8) var(--sp-20);
}

.project-form {
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-2);
  max-width     : 860px;
}


/* ============================================================
   FORM SECTIONS — fieldset as lab-report section
   ============================================================ */
.form-section {
  border        : 1.5px solid var(--border);
  border-radius : var(--radius-sm);
  padding       : 0;
  margin        : 0;
  background    : rgba(255, 255, 255, 0.55);
  /* Ruled-line inside each section */
  background-image: linear-gradient(var(--grid-line-h) 1px, transparent 1px);
  background-size : 100% var(--grid-size);
  overflow        : hidden;
  transition      : box-shadow var(--dur-base) var(--ease-out);
}
.form-section:focus-within {
  box-shadow: 0 0 0 2px var(--accent-yellow), var(--shadow-sm);
}

/* Legend — section letter badge */
.form-section__legend {
  display       : flex;
  align-items   : center;
  gap           : var(--sp-3);
  width         : 100%;
  padding       : var(--sp-3) var(--sp-6);
  font-family   : var(--font-mono);
  font-size     : var(--text-base);
  font-weight   : 600;
  color         : var(--ink);
  background    : var(--paper-dark);
  border-bottom : 1.5px solid var(--border);
  /* Reset fieldset legend positioning */
  float         : none;
  margin        : 0;
}

.form-section__legend-letter {
  display       : inline-flex;
  align-items   : center;
  justify-content: center;
  width         : 28px;
  height        : 28px;
  background    : var(--ink);
  color         : var(--paper);
  font-size     : var(--text-sm);
  font-weight   : 700;
  border-radius : var(--radius-sm);
  flex-shrink   : 0;
  letter-spacing: 0;
}

/* Inner padding for section contents */
.form-section > *:not(.form-section__legend) {
  padding: var(--sp-5) var(--sp-6);
}
.form-section > .form-field + .form-field,
.form-section > .form-row + .form-field,
.form-section > .form-field + .form-row {
  padding-top: 0;
}


/* ============================================================
   FORM FIELDS
   ============================================================ */
.form-field {
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-2);
}

.form-row {
  display  : grid;
  grid-template-columns: 1fr 1fr;
  gap      : var(--sp-5);
  padding  : var(--sp-5) var(--sp-6) 0;
}
.form-row--narrow {
  grid-template-columns: 1fr 1fr;
}

/* Nested form-field inside form-row has no extra padding */
.form-row .form-field {
  padding: 0;
}


/* ============================================================
   LABELS
   ============================================================ */
.form-label {
  font-family : var(--font-mono);
  font-size   : var(--text-sm);
  font-weight : 600;
  color       : var(--ink);
  display     : flex;
  align-items : baseline;
  flex-wrap   : wrap;
  gap         : var(--sp-2);
}

.form-label--required::after {
  content     : '*';
  color       : var(--badge-zor-ink);
  font-weight : 700;
  margin-left : 2px;
}

.form-label__hint {
  font-family : var(--font-mono);
  font-size   : var(--text-xs);
  font-weight : 400;
  color       : var(--ink-muted);
  font-style  : italic;
}


/* ============================================================
   INPUTS + TEXTAREAS
   ============================================================ */
.form-input,
.form-select,
.form-textarea {
  font-family  : var(--font-body);
  font-size    : var(--text-base);
  color        : var(--ink);
  background   : rgba(255, 255, 255, 0.80);
  border       : 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding      : var(--sp-3) var(--sp-4);
  width        : 100%;
  transition   :
    border-color     var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out),
    box-shadow       var(--dur-base) var(--ease-out);
  outline      : none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color     : var(--ink);
  background-color : var(--paper);
  box-shadow       : 3px 3px 0 var(--border);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color       : var(--ink-faint);
  font-style  : italic;
}

.form-input--mono {
  font-family: var(--font-mono);
  font-size  : var(--text-sm);
}

/* Error state */
.form-input--error,
.form-select.form-input--error,
.form-textarea.form-input--error {
  border-color: var(--badge-zor-border);
  background  : rgba(255, 208, 208, 0.30);
  box-shadow  : 2px 2px 0 var(--badge-zor-border);
}

/* Select wrapper */
.form-select-wrap {
  position: relative;
}
.form-select {
  appearance      : none;
  -webkit-appearance: none;
  padding-right   : var(--sp-8);
  cursor          : pointer;
}
.form-select-arrow {
  position        : absolute;
  right           : var(--sp-3);
  top             : 50%;
  transform       : translateY(-50%);
  font-size       : var(--text-xs);
  color           : var(--ink-secondary);
  pointer-events  : none;
}

/* Textarea sizes */
.form-textarea {
  resize       : vertical;
  min-height   : 80px;
  line-height  : 1.65;
}
.form-textarea--short { min-height:  80px; }
.form-textarea--tall  { min-height: 180px; }

/* Code textarea */
.form-textarea--code {
  font-family  : var(--font-mono);
  font-size    : 0.82rem;
  line-height  : 1.75;
  resize       : none;         /* code editor height is fixed */
  min-height   : unset;
  background   : transparent;
  border       : none;
  padding      : var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-3);
  color        : #cdd6f4;
  caret-color  : var(--accent-yellow);
  flex         : 1;
  tab-size     : 2;
  white-space  : pre;
  overflow-x   : auto;
  box-shadow   : none;
}
.form-textarea--code:focus {
  border       : none;
  box-shadow   : none;
  background   : transparent;
}
.form-textarea--code::placeholder {
  color  : rgba(205, 214, 244, 0.30);
  font-style: italic;
}


/* ============================================================
   CODE EDITOR WIDGET
   ============================================================ */
.code-editor-wrap {
  border-radius: var(--radius-md);
  overflow     : hidden;
  box-shadow   : var(--shadow-md);
}

.code-editor-toolbar {
  display     : flex;
  align-items : center;
  gap         : var(--sp-2);
  background  : #1a1c23;
  padding     : var(--sp-3) var(--sp-4);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  user-select : none;
}

.code-editor-dot {
  width        : 12px;
  height       : 12px;
  border-radius: 50%;
  flex-shrink  : 0;
}
.code-editor-dot--red    { background:#ff5f57; box-shadow:0 0 0 1px rgba(0,0,0,.25); }
.code-editor-dot--yellow { background:#febc2e; box-shadow:0 0 0 1px rgba(0,0,0,.25); }
.code-editor-dot--green  { background:#28c840; box-shadow:0 0 0 1px rgba(0,0,0,.25); }

.code-editor-filename {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : rgba(255,255,255,0.45);
  margin-left   : var(--sp-3);
  letter-spacing: 0.04em;
}

.code-editor-body {
  display         : flex;
  background-color: #1e2030;
  background-image: repeating-linear-gradient(
    0deg, rgba(0,0,0,.08) 0px, rgba(0,0,0,.08) 1px, transparent 1px, transparent 3px
  );
  overflow        : hidden;
}

.code-line-numbers {
  font-family     : var(--font-mono);
  font-size       : 0.82rem;
  line-height     : 1.75;
  color           : rgba(255,255,255,0.20);
  padding         : var(--sp-4) var(--sp-3) var(--sp-4) var(--sp-4);
  text-align      : right;
  white-space     : pre;
  user-select     : none;
  min-width       : 38px;
  border-right    : 1px solid rgba(255,255,255,0.07);
  flex-shrink     : 0;
  overflow        : hidden;
}


/* ============================================================
   HELPER TEXT
   ============================================================ */
.form-hint {
  font-size  : var(--text-xs);
  color      : var(--ink-muted);
  font-style : italic;
  line-height: 1.5;
}

.form-error {
  font-family : var(--font-mono);
  font-size   : var(--text-xs);
  color       : var(--badge-zor-ink);
  font-weight : 500;
  display     : flex;
  align-items : center;
  gap         : var(--sp-1);
}
.form-error::before {
  content: '⚠ ';
}
.form-error[hidden] { display: none; }

.form-field__footer {
  display        : flex;
  justify-content: space-between;
  align-items    : center;
  gap            : var(--sp-2);
  min-height     : 1.4em;
}

.form-char-counter {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : var(--ink-faint);
  margin-left   : auto;
  transition    : color var(--dur-fast) var(--ease-out);
}
.form-char-counter--warn { color: var(--badge-orta-ink); }
.form-char-counter--over { color: var(--badge-zor-ink); font-weight: 700; }


/* ============================================================
   MATERIALS PREVIEW
   ============================================================ */
.materials-preview {
  margin-top  : 0;
  padding     : var(--sp-3) var(--sp-6);
  border-top  : 1px dashed var(--border);
  background  : rgba(255,255,255,0.40);
}
.materials-preview[hidden] { display: none; }

.materials-preview__label {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : var(--ink-muted);
  margin-bottom : var(--sp-2);
  font-style    : italic;
}

.materials-preview__list {
  display    : flex;
  flex-wrap  : wrap;
  gap        : var(--sp-2);
  list-style : none;
}

.materials-preview__item {
  font-family  : var(--font-mono);
  font-size    : var(--text-xs);
  color        : var(--ink);
  background   : var(--badge-kolay-bg);
  border       : 1px solid var(--badge-kolay-border);
  border-radius: var(--radius-sm);
  padding      : 2px 9px;
  white-space  : nowrap;
}

.preview-qty {
  font-weight : 700;
  color       : var(--badge-kolay-ink);
  margin-right: var(--sp-1);
}


/* ============================================================
   FORM ACTIONS
   ============================================================ */
.form-actions {
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-4);
  padding-block : var(--sp-4) 0;
}

.form-actions__buttons {
  display    : flex;
  align-items: center;
  gap        : var(--sp-3);
  flex-wrap  : wrap;
}

.form-actions__submit {
  gap: var(--sp-3);
}

.form-summary-error {
  display     : flex;
  align-items : center;
  gap         : var(--sp-3);
  padding     : var(--sp-3) var(--sp-5);
  background  : var(--badge-zor-bg);
  border      : 1.5px solid var(--badge-zor-border);
  border-radius: var(--radius-sm);
  font-family : var(--font-mono);
  font-size   : var(--text-sm);
  color       : var(--badge-zor-ink);
  font-weight : 500;
  box-shadow  : 2px 2px 0 var(--badge-zor-border);
}
.form-summary-error[hidden] { display: none; }
.form-summary-error__icon   { font-size: var(--text-base); flex-shrink: 0; }


/* ============================================================
   SUCCESS STATE
   ============================================================ */
.form-success {
  max-width     : 540px;
  margin-inline : auto;
  padding-block : var(--sp-16);
}
.form-success[hidden] { display: none; }

.form-success__inner {
  display       : flex;
  flex-direction: column;
  align-items   : center;
  gap           : var(--sp-4);
  text-align    : center;
  background    : rgba(255,255,255,0.70);
  border        : 2px solid var(--badge-kolay-border);
  border-radius : var(--radius-md);
  padding       : var(--sp-10) var(--sp-8);
  box-shadow    : var(--shadow-md);
}

.form-success__stamp {
  width         : 72px;
  height        : 72px;
  background    : var(--badge-kolay-bg);
  border        : 3px solid var(--badge-kolay-border);
  border-radius : 50%;
  display       : flex;
  align-items   : center;
  justify-content: center;
  font-size     : var(--text-2xl);
  color         : var(--badge-kolay-ink);
  font-weight   : 700;
  box-shadow    : 3px 3px 0 var(--badge-kolay-border);

  animation     : successPop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes successPop {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

.form-success__title {
  font-size  : var(--text-2xl);
  font-weight: 700;
  color      : var(--ink);
}

.form-success__message {
  color      : var(--ink-secondary);
  font-size  : var(--text-base);
  max-width  : 32ch;
}

.form-success__progress {
  width        : 100%;
  height       : 4px;
  background   : var(--border);
  border-radius: var(--radius-pill);
  overflow     : hidden;
}
.form-success__progress-bar {
  height       : 100%;
  width        : 0%;
  background   : var(--badge-kolay-border);
  border-radius: var(--radius-pill);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .form-page-header__inner {
    flex-direction: column;
    gap: var(--sp-4);
  }

  .form-page-header__stamp {
    align-self: flex-start;
  }

  .form-meta-strip {
    flex-wrap: wrap;
  }

  .form-meta-strip__item {
    min-width : 100px;
    padding   : var(--sp-2) var(--sp-4);
  }

  .form-row {
    grid-template-columns : 1fr;
    gap                   : 0;
  }

  .form-row .form-field {
    padding-bottom: var(--sp-4);
  }

  .form-section > *:not(.form-section__legend) {
    padding: var(--sp-4);
  }

  .code-editor-body {
    flex-direction: column;
  }

  .code-line-numbers {
    display: none;  /* hide line numbers on small screens */
  }

  .form-textarea--code {
    padding: var(--sp-3);
  }

  .form-actions__buttons {
    flex-direction: column;
    align-items   : stretch;
  }

  .form-actions__submit,
  .form-actions__cancel {
    width          : 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .form-page-header__title {
    font-size: var(--text-xl);
  }

  .form-section__legend {
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--text-sm);
  }

  .form-section > *:not(.form-section__legend) {
    padding: var(--sp-3);
  }

  .form-success__inner {
    padding: var(--sp-8) var(--sp-5);
  }
}
/* ============================================================
   ElektroDefter — style.css
   Theme: The Engineering Notebook (Kareli Defter)
   Fonts: Fira Code (mono/display) · DM Sans (body)
   ============================================================ */


/* ============================================================
   0. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  /* Paper & Background */
  --paper:          #faf9f4;
  --paper-dark:     #f2f0e8;
  --paper-shadow:   #e8e5d8;
  --grid-line:      rgba(180, 200, 220, 0.45);
  --grid-line-h:    rgba(160, 185, 210, 0.30);
  --margin-line:    rgba(220, 80, 80, 0.25);
  --grid-size:      28px;

  /* Ink Colors */
  --ink:            #1e2a38;
  --ink-secondary:  #4a5568;
  --ink-muted:      #8898aa;
  --ink-faint:      #b8c4ce;

  /* Accent / Highlighters */
  --accent-yellow:  #ffe066;
  --accent-green:   #b8f5c8;
  --accent-blue:    #a8d8f0;
  --accent-red:     #ffb3b3;
  --accent-orange:  #ffd4a0;

  /* Difficulty Badge Colors */
  --badge-kolay-bg:   #c8f5d8;
  --badge-kolay-ink:  #1a6b3a;
  --badge-kolay-border: #5ec47a;
  --badge-orta-bg:    #fde5bc;
  --badge-orta-ink:   #7a4210;
  --badge-orta-border: #f0a040;
  --badge-zor-bg:     #ffd0d0;
  --badge-zor-ink:    #7a1a1a;
  --badge-zor-border: #e06060;

  /* UI Chrome */
  --border:         #ccc8b8;
  --border-strong:  #a09880;
  --border-rule:    #2c3e50;
  --shadow-sm:      2px 3px 8px rgba(60, 50, 30, 0.10);
  --shadow-md:      4px 6px 18px rgba(60, 50, 30, 0.14);
  --shadow-card:    3px 5px 20px rgba(60, 50, 30, 0.12),
                    0 1px 3px rgba(60, 50, 30, 0.08);
  --shadow-lift:    6px 10px 32px rgba(60, 50, 30, 0.20);

  /* Radius */
  --radius-sm:      3px;
  --radius-md:      6px;
  --radius-lg:      10px;
  --radius-pill:    100px;

  /* Spacing Scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* Typography */
  --font-mono:  'Fira Code', 'Courier New', monospace;
  --font-body:  'DM Sans', 'Segoe UI', sans-serif;

  --text-xs:   0.72rem;
  --text-sm:   0.85rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.3rem;
  --text-2xl:  1.6rem;
  --text-3xl:  2.1rem;
  --text-4xl:  2.8rem;
  --text-5xl:  3.8rem;

  /* Layout */
  --container-max: 1200px;
  --container-pad: clamp(var(--sp-4), 5vw, var(--sp-10));

  /* Transitions */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:   120ms;
  --dur-base:   220ms;
  --dur-slow:   400ms;
}


/* ============================================================
   1. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);

  /* ── Graph paper: fine minor grid + bolder major grid ── */
  background-image:
    /* Margin line at ~72px from left */
    linear-gradient(90deg, transparent 71px, var(--margin-line) 71px, var(--margin-line) 73px, transparent 73px),
    /* Major grid — every 4 cells */
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    /* Minor grid */
    linear-gradient(var(--grid-line-h) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-h) 1px, transparent 1px);
  background-size:
    100% 100%,
    calc(var(--grid-size) * 4) calc(var(--grid-size) * 4),
    calc(var(--grid-size) * 4) calc(var(--grid-size) * 4),
    var(--grid-size) var(--grid-size),
    var(--grid-size) var(--grid-size);
  background-attachment: local;

  min-height: 100vh;
  overflow-x: hidden;
}

/* Screen-reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Container */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Lists without default bullets */
ul, ol {
  list-style: none;
}

/* Link base */
a {
  color: inherit;
  text-decoration: none;
}

/* Images */
img, svg {
  display: block;
  max-width: 100%;
}

/* Focus ring — keyboard-friendly */
:focus-visible {
  outline: 2.5px dashed var(--ink);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Page-load fade-in */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
body {
  animation: pageFadeIn 0.45s var(--ease-out) both;
}


/* ============================================================
   2. TYPOGRAPHY SYSTEM
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl);  }

p  { font-family: var(--font-body); }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}


/* ============================================================
   3. GLOBAL BUTTON SYSTEM
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  padding: 0.62rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-base) var(--ease-out),
    border-color     var(--dur-base) var(--ease-out),
    color            var(--dur-base) var(--ease-out),
    transform        var(--dur-fast) var(--ease-spring),
    box-shadow       var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  background: none;
}

/* Ink-sketch border feel — pseudo underline decoration */
.btn::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 8%;
  width: 84%; height: 2px;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out),
              bottom  var(--dur-base) var(--ease-out);
}

/* Primary — filled ink button */
.btn--primary {
  background-color: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--border-strong);
}
.btn--primary:hover {
  background-color: var(--ink-secondary);
  border-color: var(--ink-secondary);
  box-shadow: 5px 5px 0 var(--border-strong);
  transform: translate(-1px, -1px);
}
.btn--primary:active {
  box-shadow: 1px 1px 0 var(--border-strong);
  transform: translate(1px, 1px);
}

/* Secondary — outlined */
.btn--secondary {
  background-color: transparent;
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--border);
}
.btn--secondary:hover {
  background-color: var(--accent-yellow);
  border-color: var(--ink);
  box-shadow: 5px 5px 0 var(--border);
  transform: translate(-1px, -1px);
}
.btn--secondary:active {
  box-shadow: 1px 1px 0 var(--border);
  transform: translate(1px, 1px);
}

/* Ghost — text only */
.btn--ghost {
  color: var(--ink-secondary);
  border-color: transparent;
  padding-inline: var(--sp-2);
}
.btn--ghost::after {
  opacity: 0.35;
  bottom: 2px;
}
.btn--ghost:hover {
  color: var(--ink);
  background-color: var(--accent-yellow);
  border-color: transparent;
}
.btn--ghost:hover::after {
  opacity: 0.7;
}

/* Inspect — card CTA */
.btn--inspect {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  background-color: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink-secondary);
  border-radius: var(--radius-sm);
}
.btn--inspect:hover {
  background-color: var(--accent-yellow);
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-1px, -1px);
}
.btn--inspect:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

/* Large modifier */
.btn--large {
  font-size: var(--text-base);
  padding: 0.85rem 1.75rem;
}

/* Add-project icon */
.btn--add-project .btn__icon {
  font-size: 1.1em;
  font-weight: 300;
  line-height: 1;
}


/* ============================================================
   4. HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--paper);
  /* Graph paper continues through header via transparency on background */
  background-image:
    linear-gradient(var(--grid-line-h) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-h) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);

  /* Hand-drawn thick bottom border — double line trick */
  border-bottom: 3px solid var(--ink);
  box-shadow:
    0 2px 0 0 var(--paper-dark),
    0 3px 0 0 var(--ink),
    0 5px 18px rgba(60, 50, 30, 0.10);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding-block: var(--sp-4);
}

/* Logo */
.site-logo {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-bracket {
  color: var(--ink-muted);
  font-weight: 300;
  font-size: 1.2em;
  line-height: 1;
}
.logo-text {
  padding-inline: 0.05em;
}

/* Blinking cursor animation */
.logo-cursor {
  font-weight: 300;
  color: var(--ink-secondary);
  animation: blink 1.1s step-start infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Header Nav */
.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}
.header-nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.header-nav__link {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--ink-secondary);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  position: relative;
  transition: color var(--dur-base) var(--ease-out);
}
/* Highlighter hover effect */
.header-nav__link::before {
  content: '';
  position: absolute;
  bottom: 4px; left: 6px;
  right: 6px; height: 8px;
  background-color: var(--accent-yellow);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
  border-radius: 2px;
}
.header-nav__link:hover,
.header-nav__link--active {
  color: var(--ink);
}
.header-nav__link:hover::before,
.header-nav__link--active::before {
  transform: scaleX(1);
}


/* ============================================================
   5. HERO SECTION
   ============================================================ */
.hero-section {
  position: relative;
  padding-block: var(--sp-16) var(--sp-12);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-10);
  align-items: center;
}

/* Eye brow label */
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-bottom: var(--sp-3);
  letter-spacing: 0.04em;
}

/* Headline */
.hero-headline {
  font-size: clamp(var(--text-3xl), 5.5vw, var(--text-5xl));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-5);
  /* Slight underline decoration on the text — pencil stroke feel */
  position: relative;
}

.hero-headline__accent {
  font-style: normal;
  display: inline-block;
  position: relative;
}
/* Yellow highlighter swipe under accent */
.hero-headline__accent::after {
  content: '';
  position: absolute;
  bottom: 4px; left: -2px;
  width: calc(100% + 4px);
  height: 0.45em;
  background-color: var(--accent-yellow);
  z-index: -1;
  transform: rotate(-0.8deg) skewX(-3deg);
  opacity: 0.75;
}

/* Sub text */
.hero-subtext {
  font-size: var(--text-lg);
  color: var(--ink-secondary);
  line-height: 1.7;
  max-width: 52ch;
  margin-bottom: var(--sp-8);
}

/* Hero actions */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

/* Notebook doodle panel */
.hero-notebook-doodle {
  width: clamp(200px, 22vw, 280px);
  aspect-ratio: 3 / 4;
  background-color: rgba(255, 255, 255, 0.55);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transform: rotate(1.5deg);
  padding: var(--sp-5);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Inner ruled lines of the doodle card */
.sketch-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px);
  background-size: 100% var(--grid-size);
  opacity: 0.6;
}

.sketch-circuit {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding-top: var(--sp-6);
}

.sketch-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1.5px solid;
  width: fit-content;
}
.sketch-label--vcc  { background: var(--accent-red);    color: var(--badge-zor-ink);    border-color: var(--badge-zor-border);   }
.sketch-label--gnd  { background: var(--paper-shadow);  color: var(--ink-secondary);    border-color: var(--border-strong);      }
.sketch-label--pin  { background: var(--accent-blue);   color: #1a4060;                 border-color: #60a8d0;                   }

.sketch-annotation {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-style: italic;
  margin-top: auto;
  padding-top: var(--sp-4);
}

/* Decorative ruled lines at bottom of hero */
.hero-ruled-lines {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--grid-size);
  pointer-events: none;
  overflow: hidden;
}
.ruled-line {
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--grid-line);
}


/* ============================================================
   6. STATS BAR
   ============================================================ */
.stats-bar {
  background-color: var(--ink);
  color: var(--paper);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.stats-bar__inner {
  padding-block: var(--sp-4);
}

.stats-list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
}

.stats-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding-inline: var(--sp-10);
}

.stats-item--divider {
  width: 1px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.20);
  padding: 0;
  flex-direction: row;
}

.stats-item__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 400;
}
.stats-item__value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent-yellow);
  line-height: 1;
}


/* ============================================================
   7. FILTER BAR
   ============================================================ */
.filter-bar {
  padding-block: var(--sp-6) var(--sp-5);
  border-bottom: 1.5px solid var(--border);
  position: sticky;
  top: var(--header-height, 73px);
  z-index: 90;
  background-color: var(--paper);
  /* Subtle paper texture continuation */
  background-image:
    linear-gradient(var(--grid-line-h) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-h) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}

.filter-bar__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.filter-bar__label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Filter list */
.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  flex: 1;
}

/* Filter buttons — index-tab aesthetic */
.filter-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1.5px solid var(--border);
  border-bottom: none;
  background-color: var(--paper-dark);
  color: var(--ink-secondary);
  cursor: pointer;
  position: relative;
  transition:
    background-color var(--dur-base) var(--ease-out),
    color            var(--dur-base) var(--ease-out),
    transform        var(--dur-fast) var(--ease-out),
    box-shadow       var(--dur-base) var(--ease-out);
  /* Simulate tab sticking up from notebook edge */
  bottom: -1.5px;
}

/* Tab "resting" shadow */
.filter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 -3px 0 0 rgba(0,0,0,0.06);
  pointer-events: none;
}

/* Highlighter marker underline on hover */
.filter-btn::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 15%;
  width: 70%; height: 3px;
  background-color: var(--accent-yellow);
  transform: scaleX(0);
  transition: transform var(--dur-base) var(--ease-spring);
  border-radius: var(--radius-pill);
}

.filter-btn:hover {
  background-color: var(--paper);
  color: var(--ink);
  transform: translateY(-2px);
}
.filter-btn:hover::after {
  transform: scaleX(1);
}

/* Active filter tab */
.filter-btn--active,
.filter-btn[aria-pressed="true"] {
  background-color: var(--paper);
  color: var(--ink);
  border-color: var(--border-strong);
  font-weight: 600;
  transform: translateY(-3px);
  box-shadow: 0 -2px 0 0 var(--accent-yellow);
}
.filter-btn--active::after,
.filter-btn[aria-pressed="true"]::after {
  background-color: var(--accent-yellow);
  transform: scaleX(1);
}

/* Difficulty-colored active states */
.filter-btn--kolay:hover,
.filter-btn--kolay[aria-pressed="true"] {
  box-shadow: 0 -2px 0 0 var(--badge-kolay-border);
}
.filter-btn--kolay[aria-pressed="true"]::after {
  background-color: var(--badge-kolay-bg);
}
.filter-btn--orta:hover,
.filter-btn--orta[aria-pressed="true"] {
  box-shadow: 0 -2px 0 0 var(--badge-orta-border);
}
.filter-btn--orta[aria-pressed="true"]::after {
  background-color: var(--badge-orta-bg);
}
.filter-btn--zor:hover,
.filter-btn--zor[aria-pressed="true"] {
  box-shadow: 0 -2px 0 0 var(--badge-zor-border);
}
.filter-btn--zor[aria-pressed="true"]::after {
  background-color: var(--badge-zor-bg);
}

/* Search input */
.filter-bar__search {
  margin-left: auto;
  flex-shrink: 0;
}
.search-input {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink);
  background-color: rgba(255,255,255,0.7);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-4);
  width: 220px;
  transition:
    border-color var(--dur-base) var(--ease-out),
    box-shadow   var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out);
  outline: none;
}
.search-input::placeholder {
  color: var(--ink-faint);
}
.search-input:focus {
  border-color: var(--ink);
  background-color: var(--paper);
  box-shadow: 3px 3px 0 var(--border);
}


/* ============================================================
   8. PROJECTS GRID
   ============================================================ */
.projects-grid {
  padding-block: var(--sp-10) var(--sp-16);
}

.projects-grid__inner {
  container-type: inline-size;
}

/* Grid header row */
.projects-grid__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-3);
  border-bottom: 1px dashed var(--border);
}

.projects-grid__title {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--ink);
}
/* Bracket decoration for the title */
.projects-grid__title::before {
  content: '// ';
  color: var(--ink-muted);
  font-weight: 300;
}

.projects-grid__count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

/* Responsive card grid */
.cards-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: var(--sp-8);
  align-items: start;
}


/* ============================================================
   9. PROJECT CARD — "Torn Paper Taped to Notebook" Look
   ============================================================ */

/* Stagger entrance animation */
@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(var(--card-rotate, 0deg));
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(var(--card-rotate, 0deg));
  }
}

.project-card {
  --card-rotate: -0.6deg;

  position: relative;
  display: flex;
  gap: 0;
  background-color: #fffef8;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);

  transform: rotate(var(--card-rotate));
  transition:
    transform  var(--dur-slow) var(--ease-spring),
    box-shadow var(--dur-slow) var(--ease-out);

  overflow: hidden;
  /* animation moved to .card--animate class — applied by JS on first load only */
}

/* Individual rotation per card via nth-child */
.project-card:nth-child(1) { --card-rotate: -0.7deg; }
.project-card:nth-child(2) { --card-rotate:  0.5deg; }
.project-card:nth-child(3) { --card-rotate: -0.3deg; }
.project-card:nth-child(4) { --card-rotate:  0.8deg; }

/* Card lift on hover */
.project-card:hover {
  --card-rotate: 0deg;
  box-shadow: var(--shadow-lift);
  transform: rotate(0deg) translateY(-4px);
  z-index: 2;
}

/* Tape strip across the top of card — CSS only */
.project-card::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 64px;
  height: 22px;
  background-color: rgba(255, 224, 102, 0.55);
  border: 1px solid rgba(200, 170, 60, 0.35);
  border-radius: 2px;
  z-index: 3;
  pointer-events: none;
}

/* Alternating tape color for variety */
.project-card:nth-child(even)::before {
  background-color: rgba(168, 216, 240, 0.55);
  border-color: rgba(80, 150, 200, 0.30);
  transform: translateX(-40%) rotate(0.8deg);
}

/* Left margin strip — like notebook paper margin */
.project-card__notebook-margin {
  width: 36px;
  flex-shrink: 0;
  background-color: rgba(220, 80, 80, 0.04);
  border-right: 1.5px solid var(--margin-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--sp-10);
  gap: var(--sp-4);
}

.margin-line-number {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.1em;
}

/* Card body */
.project-card__body {
  flex: 1;
  padding: var(--sp-6) var(--sp-5) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  /* Horizontal ruled lines inside the card */
  background-image: linear-gradient(var(--grid-line-h) 1px, transparent 1px);
  background-size: 100% var(--grid-size);
  background-position: 0 calc(var(--grid-size) * 1.5);
}

/* Card header row */
.project-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

/* Category label */
.project-card__category {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

/* Card title */
.project-card__title {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

/* Card description */
.project-card__description {
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  line-height: 1.6;
  flex: 1;
}

/* Tech tags */
.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}
.tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-secondary);
  background-color: var(--paper-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  letter-spacing: 0.03em;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.project-card:hover .tag {
  background-color: var(--paper-shadow);
}

/* Card footer */
.project-card__footer {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border-top: 1px dashed var(--border);
  background-color: rgba(255, 255, 255, 0.50);
}

/* Card meta — likes + bookmark + date on one row */
.project-card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
}

/* Push date to the right */
.project-card__time {
  margin-left: auto;
}

/* Likes button */
.likes-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-secondary);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  transition:
    color            var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    transform        var(--dur-fast) var(--ease-spring);
}
.likes-btn:hover {
  color: var(--badge-zor-ink);
  background-color: var(--accent-red);
  transform: scale(1.08);
}
.likes-btn[aria-pressed="true"] {
  color: #c0392b;
  font-weight: 700;
}
.likes-btn__icon {
  font-size: 1em;
  line-height: 1;
  transition: transform var(--dur-fast) var(--ease-spring);
}
.likes-btn:hover .likes-btn__icon {
  transform: scale(1.25);
}

/* Date */
.project-card__time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}


/* ============================================================
   10. DIFFICULTY BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid;
  position: relative;
  /* Slight hand-drawn tilt on badges */
  transform: rotate(-0.8deg);
  transition: transform var(--dur-fast) var(--ease-spring);
  white-space: nowrap;
  flex-shrink: 0;
}
.project-card:hover .badge {
  transform: rotate(0deg);
}

/* Green — Kolay */
.badge-kolay {
  background-color: var(--badge-kolay-bg);
  color: var(--badge-kolay-ink);
  border-color: var(--badge-kolay-border);
  box-shadow: 1.5px 1.5px 0 var(--badge-kolay-border);
}

/* Orange — Orta */
.badge-orta {
  background-color: var(--badge-orta-bg);
  color: var(--badge-orta-ink);
  border-color: var(--badge-orta-border);
  box-shadow: 1.5px 1.5px 0 var(--badge-orta-border);
  transform: rotate(0.6deg);
}

/* Red — Zor */
.badge-zor {
  background-color: var(--badge-zor-bg);
  color: var(--badge-zor-ink);
  border-color: var(--badge-zor-border);
  box-shadow: 1.5px 1.5px 0 var(--badge-zor-border);
  transform: rotate(-1.1deg);
}


/* ============================================================
   11. NO RESULTS STATE
   ============================================================ */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-20) var(--sp-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}
/* Note: `hidden` attribute hides it — JS removes it */
.no-results[hidden] { display: none; }

.no-results__icon {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  color: var(--ink-faint);
  font-weight: 700;
}
.no-results__message {
  font-size: var(--text-lg);
  color: var(--ink-secondary);
  max-width: 30ch;
}


/* ============================================================
   12. CTA STRIP
   ============================================================ */
.cta-strip {
  background-color: var(--ink);
  color: var(--paper);
  padding-block: var(--sp-12);
  border-top: 3px solid var(--ink);
  position: relative;
  overflow: hidden;
}

/* Graph paper ghost on the dark bg */
.cta-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
}

.cta-strip__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.cta-strip__headline {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--paper);
  margin-bottom: var(--sp-2);
}

.cta-strip__subtext {
  color: rgba(255, 255, 255, 0.60);
  font-size: var(--text-base);
}

/* Override btn--primary for dark bg */
.cta-strip .btn--primary {
  background-color: var(--accent-yellow);
  color: var(--ink);
  border-color: var(--accent-yellow);
  box-shadow: 4px 4px 0 rgba(255,255,255,0.20);
}
.cta-strip .btn--primary:hover {
  background-color: #ffd428;
  border-color: #ffd428;
  box-shadow: 6px 6px 0 rgba(255,255,255,0.30);
}


/* ============================================================
   13. FOOTER
   ============================================================ */
.site-footer {
  background-color: var(--paper-dark);
  border-top: 3px solid var(--ink);
  box-shadow: 0 -2px 0 0 var(--paper-shadow);
  padding-block: var(--sp-10);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-8);
}

/* Brand */
.footer-brand__name {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--sp-1);
}
.footer-brand__tagline {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

/* Footer nav */
.footer-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-1) var(--sp-4);
}
.footer-nav__link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-secondary);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.footer-nav__link:hover {
  color: var(--ink);
  background-color: var(--accent-yellow);
}

/* Copyright */
.footer-copy {
  text-align: right;
}
.footer-copy__text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-secondary);
  margin-bottom: var(--sp-1);
}
.footer-copy__link {
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-copy__link:hover {
  color: var(--ink-secondary);
}
.footer-copy__made-with {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  font-style: italic;
}


/* ============================================================
   14. SCROLLBAR STYLING (Webkit)
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--paper-dark);
}
::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: var(--radius-pill);
  border: 2px solid var(--paper-dark);
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--ink-secondary);
}


/* ============================================================
   15. SELECTION COLOR
   ============================================================ */
::selection {
  background-color: var(--accent-yellow);
  color: var(--ink);
}


/* ============================================================
   16. RESPONSIVE — BREAKPOINTS
   ============================================================ */

/* ─── Large (≤ 1024px) ─── */
@media (max-width: 1024px) {
  :root {
    --grid-size: 24px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
  }
  .hero-notebook-doodle {
    width: 200px;
    aspect-ratio: 3 / 2;
    transform: rotate(1deg);
    margin-inline: auto;
  }
  .hero-section {
    padding-block: var(--sp-12) var(--sp-8);
  }

  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .footer-copy {
    grid-column: 1 / -1;
    text-align: center;
  }
  .footer-nav {
    grid-column: 1 / -1;
    text-align: center;
  }
}

/* ─── Tablet (≤ 768px) ─── */
@media (max-width: 768px) {
  :root {
    --sp-16: 3rem;
    --sp-12: 2.25rem;
    --text-5xl: 2.8rem;
    --text-4xl: 2.2rem;
  }

  .header-nav__list {
    gap: 0;
  }
  .site-logo {
    font-size: var(--text-lg);
  }

  /* Hero */
  .hero-section {
    padding-block: var(--sp-10) var(--sp-6);
  }
  .hero-notebook-doodle {
    display: none; /* hide decorative panel on mobile */
  }
  .hero-subtext {
    font-size: var(--text-base);
    max-width: 100%;
  }

  /* Stats bar */
  .stats-item {
    padding-inline: var(--sp-5);
  }
  .stats-item__value {
    font-size: var(--text-xl);
  }

  /* Filter bar */
  .filter-bar {
    top: var(--header-height, 73px);
    padding-block: var(--sp-4) var(--sp-3);
  }
  .filter-bar__inner {
    gap: var(--sp-3);
  }
  .filter-bar__search {
    margin-left: 0;
    width: 100%;
  }
  .search-input {
    width: 100%;
  }

  /* Cards */
  .cards-wrapper {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: var(--sp-6);
  }

  /* CTA strip */
  .cta-strip__inner {
    flex-direction: column;
    text-align: center;
    gap: var(--sp-6);
  }

  /* Footer */
  .site-footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--sp-5);
  }
  .footer-copy {
    grid-column: 1;
    text-align: center;
  }
  .footer-brand {
    text-align: center;
  }
}

/* ─── Mobile (≤ 480px) ─── */
@media (max-width: 480px) {
  :root {
    --container-pad: var(--sp-4);
    --grid-size: 20px;
    --text-4xl: 1.9rem;
    --text-3xl: 1.6rem;
  }

  .header-inner {
    justify-content: space-between;
  }

  /* Hero */
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-section {
    padding-block: var(--sp-8) var(--sp-4);
  }

  /* Stats: stack vertically */
  .stats-list {
    flex-direction: column;
    gap: var(--sp-3);
  }
  .stats-item--divider {
    width: 60px;
    height: 1px;
  }
  .stats-item {
    padding-inline: 0;
  }
  .stats-bar__inner {
    padding-block: var(--sp-6);
  }

  /* Filter bar: scroll horizontally */
  .filter-bar__inner {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--sp-2);
    -webkit-overflow-scrolling: touch;
  }
  .filter-list {
    flex-wrap: nowrap;
  }
  .filter-bar__search {
    min-width: 180px;
  }
  .filter-bar__label {
    display: none;
  }

  /* Cards: single column */
  .cards-wrapper {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  /* Cards: reduce rotation on tiny screens for readability */
  .project-card,
  .project-card:nth-child(1),
  .project-card:nth-child(2),
  .project-card:nth-child(3),
  .project-card:nth-child(4) {
    --card-rotate: 0deg;
  }

  /* Footer */
  .footer-nav__list {
    gap: var(--sp-1) var(--sp-2);
  }
}


/* ============================================================
   17. PRINT STYLES
   ============================================================ */
@media print {
  body {
    background-image: none;
    background-color: #fff;
  }
  .site-header,
  .filter-bar,
  .cta-strip,
  .hero-notebook-doodle,
  .stats-bar {
    display: none;
  }
  .project-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
    transform: none !important;
  }
  .project-card::before { display: none; }
  .cards-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}


/* ============================================================
   18. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .logo-cursor {
    animation: none;
    opacity: 1;
  }
  html {
    scroll-behavior: auto;
  }
}


/* ============================================================
   HIDDEN ATTRIBUTE FIX
   CSS display:flex / display:grid on components overrides the
   browser's default [hidden]{display:none} which has no
   !important. This rule re-establishes the contract globally.
   ============================================================ */
[hidden] {
  display: none !important;
}
/* ============================================================
   ElektroDefter — add-project.css
   Lab Report / Technical Spec Sheet form styles
   Link AFTER style.css in add-project.html
   ============================================================ */


/* ============================================================
   PAGE HEADER — lab report cover sheet
   ============================================================ */
.form-page-header {
  padding-block: var(--sp-8) 0;
}

.form-page-header__inner {
  display       : flex;
  align-items   : flex-start;
  gap           : var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom : 2px solid var(--ink);
  position      : relative;
}

/* Stamp */
.form-page-header__stamp {
  flex-shrink    : 0;
  width          : 72px;
  height         : 72px;
  border         : 3px solid var(--ink);
  border-radius  : var(--radius-sm);
  display        : flex;
  flex-direction : column;
  align-items    : center;
  justify-content: center;
  transform      : rotate(-4deg);
  background     : var(--paper);
  box-shadow     : 2px 2px 0 var(--border-strong);
  line-height    : 1;
  gap            : 2px;
  margin-top     : var(--sp-2);
}
.stamp-text {
  font-family : var(--font-mono);
  font-size   : var(--text-xs);
  font-weight : 700;
  color       : var(--badge-kolay-ink);
  letter-spacing: 0.1em;
}
.stamp-sub {
  font-family : var(--font-mono);
  font-size   : 0.6rem;
  color       : var(--ink-muted);
  letter-spacing: 0.06em;
}

.form-page-header__eyebrow {
  font-family : var(--font-mono);
  font-size   : var(--text-xs);
  color       : var(--ink-muted);
  margin-bottom: var(--sp-2);
}

.form-page-header__title {
  font-size    : clamp(var(--text-xl), 4vw, var(--text-3xl));
  font-weight  : 700;
  color        : var(--ink);
  margin-bottom: var(--sp-2);
  letter-spacing: -0.03em;
}

.form-page-header__sub {
  font-size : var(--text-base);
  color     : var(--ink-secondary);
  max-width : 58ch;
  line-height: 1.65;
}

/* Meta strip — report number, date, status */
.form-meta-strip {
  display       : flex;
  flex-wrap     : wrap;
  gap           : 0;
  background    : var(--paper-dark);
  border        : 1.5px solid var(--border);
  border-top    : none;
  border-radius : 0 0 var(--radius-sm) var(--radius-sm);
}

.form-meta-strip__item {
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-1);
  padding       : var(--sp-3) var(--sp-6);
  border-right  : 1.5px solid var(--border);
  flex          : 1;
  min-width     : 120px;
}
.form-meta-strip__item:last-child {
  border-right: none;
}

.form-meta-strip dt {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-meta-strip dd {
  font-family : var(--font-mono);
  font-size   : var(--text-sm);
  font-weight : 600;
  color       : var(--ink);
}

.form-meta-strip__status {
  color: var(--ink-secondary) !important;
}
.form-meta-strip__status--editing {
  color: var(--badge-orta-ink) !important;
}
.form-meta-strip__status--saved {
  color: var(--badge-kolay-ink) !important;
}


/* ============================================================
   FORM LAYOUT
   ============================================================ */
.form-main {
  padding-block: var(--sp-8) var(--sp-20);
}

.project-form {
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-2);
  max-width     : 860px;
}


/* ============================================================
   FORM SECTIONS — fieldset as lab-report section
   ============================================================ */
.form-section {
  border        : 1.5px solid var(--border);
  border-radius : var(--radius-sm);
  padding       : 0;
  margin        : 0;
  background    : rgba(255, 255, 255, 0.55);
  /* Ruled-line inside each section */
  background-image: linear-gradient(var(--grid-line-h) 1px, transparent 1px);
  background-size : 100% var(--grid-size);
  overflow        : hidden;
  transition      : box-shadow var(--dur-base) var(--ease-out);
}
.form-section:focus-within {
  box-shadow: 0 0 0 2px var(--accent-yellow), var(--shadow-sm);
}

/* Legend — section letter badge */
.form-section__legend {
  display       : flex;
  align-items   : center;
  gap           : var(--sp-3);
  width         : 100%;
  padding       : var(--sp-3) var(--sp-6);
  font-family   : var(--font-mono);
  font-size     : var(--text-base);
  font-weight   : 600;
  color         : var(--ink);
  background    : var(--paper-dark);
  border-bottom : 1.5px solid var(--border);
  /* Reset fieldset legend positioning */
  float         : none;
  margin        : 0;
}

.form-section__legend-letter {
  display       : inline-flex;
  align-items   : center;
  justify-content: center;
  width         : 28px;
  height        : 28px;
  background    : var(--ink);
  color         : var(--paper);
  font-size     : var(--text-sm);
  font-weight   : 700;
  border-radius : var(--radius-sm);
  flex-shrink   : 0;
  letter-spacing: 0;
}

/* Inner padding for section contents */
.form-section > *:not(.form-section__legend) {
  padding: var(--sp-5) var(--sp-6);
}
.form-section > .form-field + .form-field,
.form-section > .form-row + .form-field,
.form-section > .form-field + .form-row {
  padding-top: 0;
}


/* ============================================================
   FORM FIELDS
   ============================================================ */
.form-field {
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-2);
}

.form-row {
  display  : grid;
  grid-template-columns: 1fr 1fr;
  gap      : var(--sp-5);
  padding  : var(--sp-5) var(--sp-6) 0;
}
.form-row--narrow {
  grid-template-columns: 1fr 1fr;
}

/* Nested form-field inside form-row has no extra padding */
.form-row .form-field {
  padding: 0;
}


/* ============================================================
   LABELS
   ============================================================ */
.form-label {
  font-family : var(--font-mono);
  font-size   : var(--text-sm);
  font-weight : 600;
  color       : var(--ink);
  display     : flex;
  align-items : baseline;
  flex-wrap   : wrap;
  gap         : var(--sp-2);
}

.form-label--required::after {
  content     : '*';
  color       : var(--badge-zor-ink);
  font-weight : 700;
  margin-left : 2px;
}

.form-label__hint {
  font-family : var(--font-mono);
  font-size   : var(--text-xs);
  font-weight : 400;
  color       : var(--ink-muted);
  font-style  : italic;
}


/* ============================================================
   INPUTS + TEXTAREAS
   ============================================================ */
.form-input,
.form-select,
.form-textarea {
  font-family  : var(--font-body);
  font-size    : var(--text-base);
  color        : var(--ink);
  background   : rgba(255, 255, 255, 0.80);
  border       : 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding      : var(--sp-3) var(--sp-4);
  width        : 100%;
  transition   :
    border-color     var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out),
    box-shadow       var(--dur-base) var(--ease-out);
  outline      : none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color     : var(--ink);
  background-color : var(--paper);
  box-shadow       : 3px 3px 0 var(--border);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color       : var(--ink-faint);
  font-style  : italic;
}

.form-input--mono {
  font-family: var(--font-mono);
  font-size  : var(--text-sm);
}

/* Error state */
.form-input--error,
.form-select.form-input--error,
.form-textarea.form-input--error {
  border-color: var(--badge-zor-border);
  background  : rgba(255, 208, 208, 0.30);
  box-shadow  : 2px 2px 0 var(--badge-zor-border);
}

/* Select wrapper */
.form-select-wrap {
  position: relative;
}
.form-select {
  appearance      : none;
  -webkit-appearance: none;
  padding-right   : var(--sp-8);
  cursor          : pointer;
}
.form-select-arrow {
  position        : absolute;
  right           : var(--sp-3);
  top             : 50%;
  transform       : translateY(-50%);
  font-size       : var(--text-xs);
  color           : var(--ink-secondary);
  pointer-events  : none;
}

/* Textarea sizes */
.form-textarea {
  resize       : vertical;
  min-height   : 80px;
  line-height  : 1.65;
}
.form-textarea--short { min-height:  80px; }
.form-textarea--tall  { min-height: 180px; }

/* Code textarea */
.form-textarea--code {
  font-family  : var(--font-mono);
  font-size    : 0.82rem;
  line-height  : 1.75;
  resize       : none;         /* code editor height is fixed */
  min-height   : unset;
  background   : transparent;
  border       : none;
  padding      : var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-3);
  color        : #cdd6f4;
  caret-color  : var(--accent-yellow);
  flex         : 1;
  tab-size     : 2;
  white-space  : pre;
  overflow-x   : auto;
  box-shadow   : none;
}
.form-textarea--code:focus {
  border       : none;
  box-shadow   : none;
  background   : transparent;
}
.form-textarea--code::placeholder {
  color  : rgba(205, 214, 244, 0.30);
  font-style: italic;
}


/* ============================================================
   CODE EDITOR WIDGET
   ============================================================ */
.code-editor-wrap {
  border-radius: var(--radius-md);
  overflow     : hidden;
  box-shadow   : var(--shadow-md);
}

.code-editor-toolbar {
  display     : flex;
  align-items : center;
  gap         : var(--sp-2);
  background  : #1a1c23;
  padding     : var(--sp-3) var(--sp-4);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  user-select : none;
}

.code-editor-dot {
  width        : 12px;
  height       : 12px;
  border-radius: 50%;
  flex-shrink  : 0;
}
.code-editor-dot--red    { background:#ff5f57; box-shadow:0 0 0 1px rgba(0,0,0,.25); }
.code-editor-dot--yellow { background:#febc2e; box-shadow:0 0 0 1px rgba(0,0,0,.25); }
.code-editor-dot--green  { background:#28c840; box-shadow:0 0 0 1px rgba(0,0,0,.25); }

.code-editor-filename {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : rgba(255,255,255,0.45);
  margin-left   : var(--sp-3);
  letter-spacing: 0.04em;
}

.code-editor-body {
  display         : flex;
  background-color: #1e2030;
  background-image: repeating-linear-gradient(
    0deg, rgba(0,0,0,.08) 0px, rgba(0,0,0,.08) 1px, transparent 1px, transparent 3px
  );
  overflow        : hidden;
}

.code-line-numbers {
  font-family     : var(--font-mono);
  font-size       : 0.82rem;
  line-height     : 1.75;
  color           : rgba(255,255,255,0.20);
  padding         : var(--sp-4) var(--sp-3) var(--sp-4) var(--sp-4);
  text-align      : right;
  white-space     : pre;
  user-select     : none;
  min-width       : 38px;
  border-right    : 1px solid rgba(255,255,255,0.07);
  flex-shrink     : 0;
  overflow        : hidden;
}


/* ============================================================
   HELPER TEXT
   ============================================================ */
.form-hint {
  font-size  : var(--text-xs);
  color      : var(--ink-muted);
  font-style : italic;
  line-height: 1.5;
}

.form-error {
  font-family : var(--font-mono);
  font-size   : var(--text-xs);
  color       : var(--badge-zor-ink);
  font-weight : 500;
  display     : flex;
  align-items : center;
  gap         : var(--sp-1);
}
.form-error::before {
  content: '⚠ ';
}
.form-error[hidden] { display: none; }

.form-field__footer {
  display        : flex;
  justify-content: space-between;
  align-items    : center;
  gap            : var(--sp-2);
  min-height     : 1.4em;
}

.form-char-counter {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : var(--ink-faint);
  margin-left   : auto;
  transition    : color var(--dur-fast) var(--ease-out);
}
.form-char-counter--warn { color: var(--badge-orta-ink); }
.form-char-counter--over { color: var(--badge-zor-ink); font-weight: 700; }


/* ============================================================
   MATERIALS PREVIEW
   ============================================================ */
.materials-preview {
  margin-top  : 0;
  padding     : var(--sp-3) var(--sp-6);
  border-top  : 1px dashed var(--border);
  background  : rgba(255,255,255,0.40);
}
.materials-preview[hidden] { display: none; }

.materials-preview__label {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : var(--ink-muted);
  margin-bottom : var(--sp-2);
  font-style    : italic;
}

.materials-preview__list {
  display    : flex;
  flex-wrap  : wrap;
  gap        : var(--sp-2);
  list-style : none;
}

.materials-preview__item {
  font-family  : var(--font-mono);
  font-size    : var(--text-xs);
  color        : var(--ink);
  background   : var(--badge-kolay-bg);
  border       : 1px solid var(--badge-kolay-border);
  border-radius: var(--radius-sm);
  padding      : 2px 9px;
  white-space  : nowrap;
}

.preview-qty {
  font-weight : 700;
  color       : var(--badge-kolay-ink);
  margin-right: var(--sp-1);
}


/* ============================================================
   FORM ACTIONS
   ============================================================ */
.form-actions {
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-4);
  padding-block : var(--sp-4) 0;
}

.form-actions__buttons {
  display    : flex;
  align-items: center;
  gap        : var(--sp-3);
  flex-wrap  : wrap;
}

.form-actions__submit {
  gap: var(--sp-3);
}

.form-summary-error {
  display     : flex;
  align-items : center;
  gap         : var(--sp-3);
  padding     : var(--sp-3) var(--sp-5);
  background  : var(--badge-zor-bg);
  border      : 1.5px solid var(--badge-zor-border);
  border-radius: var(--radius-sm);
  font-family : var(--font-mono);
  font-size   : var(--text-sm);
  color       : var(--badge-zor-ink);
  font-weight : 500;
  box-shadow  : 2px 2px 0 var(--badge-zor-border);
}
.form-summary-error[hidden] { display: none; }
.form-summary-error__icon   { font-size: var(--text-base); flex-shrink: 0; }


/* ============================================================
   SUCCESS STATE
   ============================================================ */
.form-success {
  max-width     : 540px;
  margin-inline : auto;
  padding-block : var(--sp-16);
}
.form-success[hidden] { display: none; }

.form-success__inner {
  display       : flex;
  flex-direction: column;
  align-items   : center;
  gap           : var(--sp-4);
  text-align    : center;
  background    : rgba(255,255,255,0.70);
  border        : 2px solid var(--badge-kolay-border);
  border-radius : var(--radius-md);
  padding       : var(--sp-10) var(--sp-8);
  box-shadow    : var(--shadow-md);
}

.form-success__stamp {
  width         : 72px;
  height        : 72px;
  background    : var(--badge-kolay-bg);
  border        : 3px solid var(--badge-kolay-border);
  border-radius : 50%;
  display       : flex;
  align-items   : center;
  justify-content: center;
  font-size     : var(--text-2xl);
  color         : var(--badge-kolay-ink);
  font-weight   : 700;
  box-shadow    : 3px 3px 0 var(--badge-kolay-border);

  animation     : successPop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes successPop {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

.form-success__title {
  font-size  : var(--text-2xl);
  font-weight: 700;
  color      : var(--ink);
}

.form-success__message {
  color      : var(--ink-secondary);
  font-size  : var(--text-base);
  max-width  : 32ch;
}

.form-success__progress {
  width        : 100%;
  height       : 4px;
  background   : var(--border);
  border-radius: var(--radius-pill);
  overflow     : hidden;
}
.form-success__progress-bar {
  height       : 100%;
  width        : 0%;
  background   : var(--badge-kolay-border);
  border-radius: var(--radius-pill);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .form-page-header__inner {
    flex-direction: column;
    gap: var(--sp-4);
  }

  .form-page-header__stamp {
    align-self: flex-start;
  }

  .form-meta-strip {
    flex-wrap: wrap;
  }

  .form-meta-strip__item {
    min-width : 100px;
    padding   : var(--sp-2) var(--sp-4);
  }

  .form-row {
    grid-template-columns : 1fr;
    gap                   : 0;
  }

  .form-row .form-field {
    padding-bottom: var(--sp-4);
  }

  .form-section > *:not(.form-section__legend) {
    padding: var(--sp-4);
  }

  .code-editor-body {
    flex-direction: column;
  }

  .code-line-numbers {
    display: none;  /* hide line numbers on small screens */
  }

  .form-textarea--code {
    padding: var(--sp-3);
  }

  .form-actions__buttons {
    flex-direction: column;
    align-items   : stretch;
  }

  .form-actions__submit,
  .form-actions__cancel {
    width          : 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .form-page-header__title {
    font-size: var(--text-xl);
  }

  .form-section__legend {
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--text-sm);
  }

  .form-section > *:not(.form-section__legend) {
    padding: var(--sp-3);
  }

  .form-success__inner {
    padding: var(--sp-8) var(--sp-5);
  }
}


/* ============================================================
   MATERIAL PICKER WIDGET
   ============================================================ */

/* ── Input row: search + qty + button ── */
.mat-input-row {
  display    : flex;
  align-items: stretch;
  gap        : var(--sp-3);
  flex-wrap  : wrap;
}

.mat-input-wrap {
  position : relative;
  flex      : 1;
  min-width : 200px;
}

.mat-input-icon {
  position       : absolute;
  left           : var(--sp-3);
  top            : 50%;
  transform      : translateY(-50%);
  font-size      : var(--text-base);
  color          : var(--ink-muted);
  pointer-events : none;
  user-select    : none;
}

.mat-search-input {
  padding-left: calc(var(--sp-3) + 1.4em + var(--sp-2));
  width       : 100%;
}

/* Quantity input — compact */
.mat-qty-wrap {
  flex-shrink: 0;
  width      : 110px;
}

.mat-qty-input {
  font-family: var(--font-mono);
  font-size  : var(--text-sm);
  width      : 100%;
  text-align : center;
}

/* Add button */
.mat-add-btn {
  flex-shrink: 0;
  white-space: nowrap;
  align-self : stretch;
  padding-inline: var(--sp-5);
}


/* ── Tag area ── */
.mat-tag-area {
  padding       : var(--sp-4) var(--sp-6);
  border-top    : 1px dashed var(--border);
  min-height    : 80px;
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-3);
}

/* Empty state */
.mat-empty-state {
  display    : flex;
  align-items: center;
  gap        : var(--sp-3);
  color      : var(--ink-faint);
  font-family: var(--font-mono);
  font-size  : var(--text-sm);
  font-style : italic;
  padding    : var(--sp-4) 0;
}

.mat-empty-state__icon {
  font-size  : var(--text-xl);
  opacity    : 0.5;
  flex-shrink: 0;
}

/* Tag list */
.mat-tag-list {
  list-style : none;
  display    : flex;
  flex-wrap  : wrap;
  gap        : var(--sp-2);
  align-items: flex-start;
}

/* Individual tag pill */
.mat-tag {
  display       : inline-flex;
  align-items   : center;
  gap           : var(--sp-2);
  background    : var(--paper-dark);
  border        : 1.5px solid var(--border);
  border-radius : var(--radius-pill);
  padding       : var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-3);
  box-shadow    : 1px 1px 0 var(--border);
  transition    :
    background-color var(--dur-fast) var(--ease-out),
    border-color     var(--dur-fast) var(--ease-out),
    box-shadow       var(--dur-fast) var(--ease-out);
}

.mat-tag:hover {
  background-color: var(--accent-yellow);
  border-color    : var(--border-strong);
}

.mat-tag__inner {
  display    : flex;
  align-items: center;
  gap        : var(--sp-2);
}

.mat-tag__qty {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  font-weight   : 700;
  color         : var(--badge-kolay-ink);
  background    : var(--badge-kolay-bg);
  border        : 1px solid var(--badge-kolay-border);
  border-radius : var(--radius-sm);
  padding       : 1px 6px;
  flex-shrink   : 0;
  white-space   : nowrap;
}

.mat-tag__name {
  font-family: var(--font-body);
  font-size  : var(--text-sm);
  color      : var(--ink);
  line-height: 1.2;
}

/* Remove (×) button inside tag */
.mat-tag__remove {
  display         : inline-flex;
  align-items     : center;
  justify-content : center;
  width           : 22px;
  height          : 22px;
  border          : none;
  border-radius   : 50%;
  background      : transparent;
  color           : var(--ink-secondary);
  font-size       : 1rem;
  line-height     : 1;
  cursor          : pointer;
  flex-shrink     : 0;
  transition      :
    background-color var(--dur-fast) var(--ease-out),
    color            var(--dur-fast) var(--ease-out);
}

.mat-tag__remove:hover {
  background-color: var(--badge-zor-bg);
  color           : var(--badge-zor-ink);
}

.mat-tag__remove:focus-visible {
  outline       : 2px dashed var(--ink);
  outline-offset: 2px;
}


/* ── Summary bar ── */
.mat-summary-bar {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  padding        : var(--sp-2) var(--sp-6);
  border-top     : 1px dashed var(--border);
  background     : rgba(255,255,255,0.40);
}

.mat-summary-bar__text {
  font-family: var(--font-mono);
  font-size  : var(--text-xs);
  color      : var(--ink-secondary);
  letter-spacing: 0.03em;
}

.mat-clear-btn {
  font-size   : var(--text-xs);
  color       : var(--ink-muted);
  padding     : var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
}
.mat-clear-btn:hover {
  color           : var(--badge-zor-ink);
  background-color: var(--badge-zor-bg);
}

/* Legend count badge */
.form-section__legend-count {
  font-size  : var(--text-xs);
  font-weight: 400;
  color      : var(--ink-muted);
  margin-left: var(--sp-1);
}

/* ── Responsive ── */
@media (max-width: 540px) {
  .mat-input-row {
    flex-direction: column;
    gap: var(--sp-2);
  }
  .mat-qty-wrap  { width: 100%; }
  .mat-add-btn   { width: 100%; justify-content: center; }
  .mat-input-wrap{ min-width: unset; }
}
/* ============================================================
   ElektroDefter — add-project.css
   Lab Report / Technical Spec Sheet form styles
   Link AFTER style.css in add-project.html
   ============================================================ */


/* ============================================================
   PAGE HEADER — lab report cover sheet
   ============================================================ */
.form-page-header {
  padding-block: var(--sp-8) 0;
}

.form-page-header__inner {
  display       : flex;
  align-items   : flex-start;
  gap           : var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom : 2px solid var(--ink);
  position      : relative;
}

/* Stamp */
.form-page-header__stamp {
  flex-shrink    : 0;
  width          : 72px;
  height         : 72px;
  border         : 3px solid var(--ink);
  border-radius  : var(--radius-sm);
  display        : flex;
  flex-direction : column;
  align-items    : center;
  justify-content: center;
  transform      : rotate(-4deg);
  background     : var(--paper);
  box-shadow     : 2px 2px 0 var(--border-strong);
  line-height    : 1;
  gap            : 2px;
  margin-top     : var(--sp-2);
}
.stamp-text {
  font-family : var(--font-mono);
  font-size   : var(--text-xs);
  font-weight : 700;
  color       : var(--badge-kolay-ink);
  letter-spacing: 0.1em;
}
.stamp-sub {
  font-family : var(--font-mono);
  font-size   : 0.6rem;
  color       : var(--ink-muted);
  letter-spacing: 0.06em;
}

.form-page-header__eyebrow {
  font-family : var(--font-mono);
  font-size   : var(--text-xs);
  color       : var(--ink-muted);
  margin-bottom: var(--sp-2);
}

.form-page-header__title {
  font-size    : clamp(var(--text-xl), 4vw, var(--text-3xl));
  font-weight  : 700;
  color        : var(--ink);
  margin-bottom: var(--sp-2);
  letter-spacing: -0.03em;
}

.form-page-header__sub {
  font-size : var(--text-base);
  color     : var(--ink-secondary);
  max-width : 58ch;
  line-height: 1.65;
}

/* Meta strip — report number, date, status */
.form-meta-strip {
  display       : flex;
  flex-wrap     : wrap;
  gap           : 0;
  background    : var(--paper-dark);
  border        : 1.5px solid var(--border);
  border-top    : none;
  border-radius : 0 0 var(--radius-sm) var(--radius-sm);
}

.form-meta-strip__item {
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-1);
  padding       : var(--sp-3) var(--sp-6);
  border-right  : 1.5px solid var(--border);
  flex          : 1;
  min-width     : 120px;
}
.form-meta-strip__item:last-child {
  border-right: none;
}

.form-meta-strip dt {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-meta-strip dd {
  font-family : var(--font-mono);
  font-size   : var(--text-sm);
  font-weight : 600;
  color       : var(--ink);
}

.form-meta-strip__status {
  color: var(--ink-secondary) !important;
}
.form-meta-strip__status--editing {
  color: var(--badge-orta-ink) !important;
}
.form-meta-strip__status--saved {
  color: var(--badge-kolay-ink) !important;
}


/* ============================================================
   FORM LAYOUT
   ============================================================ */
.form-main {
  padding-block: var(--sp-8) var(--sp-20);
}

.project-form {
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-2);
  max-width     : 860px;
}


/* ============================================================
   FORM SECTIONS — fieldset as lab-report section
   ============================================================ */
.form-section {
  border        : 1.5px solid var(--border);
  border-radius : var(--radius-sm);
  padding       : 0;
  margin        : 0;
  background    : rgba(255, 255, 255, 0.55);
  /* Ruled-line inside each section */
  background-image: linear-gradient(var(--grid-line-h) 1px, transparent 1px);
  background-size : 100% var(--grid-size);
  overflow        : hidden;
  transition      : box-shadow var(--dur-base) var(--ease-out);
}
.form-section:focus-within {
  box-shadow: 0 0 0 2px var(--accent-yellow), var(--shadow-sm);
}

/* Legend — section letter badge */
.form-section__legend {
  display       : flex;
  align-items   : center;
  gap           : var(--sp-3);
  width         : 100%;
  padding       : var(--sp-3) var(--sp-6);
  font-family   : var(--font-mono);
  font-size     : var(--text-base);
  font-weight   : 600;
  color         : var(--ink);
  background    : var(--paper-dark);
  border-bottom : 1.5px solid var(--border);
  /* Reset fieldset legend positioning */
  float         : none;
  margin        : 0;
}

.form-section__legend-letter {
  display       : inline-flex;
  align-items   : center;
  justify-content: center;
  width         : 28px;
  height        : 28px;
  background    : var(--ink);
  color         : var(--paper);
  font-size     : var(--text-sm);
  font-weight   : 700;
  border-radius : var(--radius-sm);
  flex-shrink   : 0;
  letter-spacing: 0;
}

/* Inner padding for section contents */
.form-section > *:not(.form-section__legend) {
  padding: var(--sp-5) var(--sp-6);
}
.form-section > .form-field + .form-field,
.form-section > .form-row + .form-field,
.form-section > .form-field + .form-row {
  padding-top: 0;
}


/* ============================================================
   FORM FIELDS
   ============================================================ */
.form-field {
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-2);
}

.form-row {
  display  : grid;
  grid-template-columns: 1fr 1fr;
  gap      : var(--sp-5);
  padding  : var(--sp-5) var(--sp-6) 0;
}
.form-row--narrow {
  grid-template-columns: 1fr 1fr;
}

/* Nested form-field inside form-row has no extra padding */
.form-row .form-field {
  padding: 0;
}


/* ============================================================
   LABELS
   ============================================================ */
.form-label {
  font-family : var(--font-mono);
  font-size   : var(--text-sm);
  font-weight : 600;
  color       : var(--ink);
  display     : flex;
  align-items : baseline;
  flex-wrap   : wrap;
  gap         : var(--sp-2);
}

.form-label--required::after {
  content     : '*';
  color       : var(--badge-zor-ink);
  font-weight : 700;
  margin-left : 2px;
}

.form-label__hint {
  font-family : var(--font-mono);
  font-size   : var(--text-xs);
  font-weight : 400;
  color       : var(--ink-muted);
  font-style  : italic;
}


/* ============================================================
   INPUTS + TEXTAREAS
   ============================================================ */
.form-input,
.form-select,
.form-textarea {
  font-family  : var(--font-body);
  font-size    : var(--text-base);
  color        : var(--ink);
  background   : rgba(255, 255, 255, 0.80);
  border       : 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding      : var(--sp-3) var(--sp-4);
  width        : 100%;
  transition   :
    border-color     var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out),
    box-shadow       var(--dur-base) var(--ease-out);
  outline      : none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color     : var(--ink);
  background-color : var(--paper);
  box-shadow       : 3px 3px 0 var(--border);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color       : var(--ink-faint);
  font-style  : italic;
}

.form-input--mono {
  font-family: var(--font-mono);
  font-size  : var(--text-sm);
}

/* Error state */
.form-input--error,
.form-select.form-input--error,
.form-textarea.form-input--error {
  border-color: var(--badge-zor-border);
  background  : rgba(255, 208, 208, 0.30);
  box-shadow  : 2px 2px 0 var(--badge-zor-border);
}

/* Select wrapper */
.form-select-wrap {
  position: relative;
}
.form-select {
  appearance      : none;
  -webkit-appearance: none;
  padding-right   : var(--sp-8);
  cursor          : pointer;
}
.form-select-arrow {
  position        : absolute;
  right           : var(--sp-3);
  top             : 50%;
  transform       : translateY(-50%);
  font-size       : var(--text-xs);
  color           : var(--ink-secondary);
  pointer-events  : none;
}

/* Textarea sizes */
.form-textarea {
  resize       : vertical;
  min-height   : 80px;
  line-height  : 1.65;
}
.form-textarea--short { min-height:  80px; }
.form-textarea--tall  { min-height: 180px; }

/* Code textarea */
.form-textarea--code {
  font-family  : var(--font-mono);
  font-size    : 0.82rem;
  line-height  : 1.75;
  resize       : none;         /* code editor height is fixed */
  min-height   : unset;
  background   : transparent;
  border       : none;
  padding      : var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-3);
  color        : #cdd6f4;
  caret-color  : var(--accent-yellow);
  flex         : 1;
  tab-size     : 2;
  white-space  : pre;
  overflow-x   : auto;
  box-shadow   : none;
}
.form-textarea--code:focus {
  border       : none;
  box-shadow   : none;
  background   : transparent;
}
.form-textarea--code::placeholder {
  color  : rgba(205, 214, 244, 0.30);
  font-style: italic;
}


/* ============================================================
   CODE EDITOR WIDGET
   ============================================================ */
.code-editor-wrap {
  border-radius: var(--radius-md);
  overflow     : hidden;
  box-shadow   : var(--shadow-md);
}

.code-editor-toolbar {
  display     : flex;
  align-items : center;
  gap         : var(--sp-2);
  background  : #1a1c23;
  padding     : var(--sp-3) var(--sp-4);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  user-select : none;
}

.code-editor-dot {
  width        : 12px;
  height       : 12px;
  border-radius: 50%;
  flex-shrink  : 0;
}
.code-editor-dot--red    { background:#ff5f57; box-shadow:0 0 0 1px rgba(0,0,0,.25); }
.code-editor-dot--yellow { background:#febc2e; box-shadow:0 0 0 1px rgba(0,0,0,.25); }
.code-editor-dot--green  { background:#28c840; box-shadow:0 0 0 1px rgba(0,0,0,.25); }

.code-editor-filename {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : rgba(255,255,255,0.45);
  margin-left   : var(--sp-3);
  letter-spacing: 0.04em;
}

.code-editor-body {
  display         : flex;
  background-color: #1e2030;
  background-image: repeating-linear-gradient(
    0deg, rgba(0,0,0,.08) 0px, rgba(0,0,0,.08) 1px, transparent 1px, transparent 3px
  );
  overflow        : hidden;
}

.code-line-numbers {
  font-family     : var(--font-mono);
  font-size       : 0.82rem;
  line-height     : 1.75;
  color           : rgba(255,255,255,0.20);
  padding         : var(--sp-4) var(--sp-3) var(--sp-4) var(--sp-4);
  text-align      : right;
  white-space     : pre;
  user-select     : none;
  min-width       : 38px;
  border-right    : 1px solid rgba(255,255,255,0.07);
  flex-shrink     : 0;
  overflow        : hidden;
}


/* ============================================================
   HELPER TEXT
   ============================================================ */
.form-hint {
  font-size  : var(--text-xs);
  color      : var(--ink-muted);
  font-style : italic;
  line-height: 1.5;
}

.form-error {
  font-family : var(--font-mono);
  font-size   : var(--text-xs);
  color       : var(--badge-zor-ink);
  font-weight : 500;
  display     : flex;
  align-items : center;
  gap         : var(--sp-1);
}
.form-error::before {
  content: '⚠ ';
}
.form-error[hidden] { display: none; }

.form-field__footer {
  display        : flex;
  justify-content: space-between;
  align-items    : center;
  gap            : var(--sp-2);
  min-height     : 1.4em;
}

.form-char-counter {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : var(--ink-faint);
  margin-left   : auto;
  transition    : color var(--dur-fast) var(--ease-out);
}
.form-char-counter--warn { color: var(--badge-orta-ink); }
.form-char-counter--over { color: var(--badge-zor-ink); font-weight: 700; }


/* ============================================================
   MATERIALS PREVIEW
   ============================================================ */
.materials-preview {
  margin-top  : 0;
  padding     : var(--sp-3) var(--sp-6);
  border-top  : 1px dashed var(--border);
  background  : rgba(255,255,255,0.40);
}
.materials-preview[hidden] { display: none; }

.materials-preview__label {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : var(--ink-muted);
  margin-bottom : var(--sp-2);
  font-style    : italic;
}

.materials-preview__list {
  display    : flex;
  flex-wrap  : wrap;
  gap        : var(--sp-2);
  list-style : none;
}

.materials-preview__item {
  font-family  : var(--font-mono);
  font-size    : var(--text-xs);
  color        : var(--ink);
  background   : var(--badge-kolay-bg);
  border       : 1px solid var(--badge-kolay-border);
  border-radius: var(--radius-sm);
  padding      : 2px 9px;
  white-space  : nowrap;
}

.preview-qty {
  font-weight : 700;
  color       : var(--badge-kolay-ink);
  margin-right: var(--sp-1);
}


/* ============================================================
   FORM ACTIONS
   ============================================================ */
.form-actions {
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-4);
  padding-block : var(--sp-4) 0;
}

.form-actions__buttons {
  display    : flex;
  align-items: center;
  gap        : var(--sp-3);
  flex-wrap  : wrap;
}

.form-actions__submit {
  gap: var(--sp-3);
}

.form-summary-error {
  display     : flex;
  align-items : center;
  gap         : var(--sp-3);
  padding     : var(--sp-3) var(--sp-5);
  background  : var(--badge-zor-bg);
  border      : 1.5px solid var(--badge-zor-border);
  border-radius: var(--radius-sm);
  font-family : var(--font-mono);
  font-size   : var(--text-sm);
  color       : var(--badge-zor-ink);
  font-weight : 500;
  box-shadow  : 2px 2px 0 var(--badge-zor-border);
}
.form-summary-error[hidden] { display: none; }
.form-summary-error__icon   { font-size: var(--text-base); flex-shrink: 0; }


/* ============================================================
   SUCCESS STATE
   ============================================================ */
.form-success {
  max-width     : 540px;
  margin-inline : auto;
  padding-block : var(--sp-16);
}
.form-success[hidden] { display: none; }

.form-success__inner {
  display       : flex;
  flex-direction: column;
  align-items   : center;
  gap           : var(--sp-4);
  text-align    : center;
  background    : rgba(255,255,255,0.70);
  border        : 2px solid var(--badge-kolay-border);
  border-radius : var(--radius-md);
  padding       : var(--sp-10) var(--sp-8);
  box-shadow    : var(--shadow-md);
}

.form-success__stamp {
  width         : 72px;
  height        : 72px;
  background    : var(--badge-kolay-bg);
  border        : 3px solid var(--badge-kolay-border);
  border-radius : 50%;
  display       : flex;
  align-items   : center;
  justify-content: center;
  font-size     : var(--text-2xl);
  color         : var(--badge-kolay-ink);
  font-weight   : 700;
  box-shadow    : 3px 3px 0 var(--badge-kolay-border);

  animation     : successPop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes successPop {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

.form-success__title {
  font-size  : var(--text-2xl);
  font-weight: 700;
  color      : var(--ink);
}

.form-success__message {
  color      : var(--ink-secondary);
  font-size  : var(--text-base);
  max-width  : 32ch;
}

.form-success__progress {
  width        : 100%;
  height       : 4px;
  background   : var(--border);
  border-radius: var(--radius-pill);
  overflow     : hidden;
}
.form-success__progress-bar {
  height       : 100%;
  width        : 0%;
  background   : var(--badge-kolay-border);
  border-radius: var(--radius-pill);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .form-page-header__inner {
    flex-direction: column;
    gap: var(--sp-4);
  }

  .form-page-header__stamp {
    align-self: flex-start;
  }

  .form-meta-strip {
    flex-wrap: wrap;
  }

  .form-meta-strip__item {
    min-width : 100px;
    padding   : var(--sp-2) var(--sp-4);
  }

  .form-row {
    grid-template-columns : 1fr;
    gap                   : 0;
  }

  .form-row .form-field {
    padding-bottom: var(--sp-4);
  }

  .form-section > *:not(.form-section__legend) {
    padding: var(--sp-4);
  }

  .code-editor-body {
    flex-direction: column;
  }

  .code-line-numbers {
    display: none;  /* hide line numbers on small screens */
  }

  .form-textarea--code {
    padding: var(--sp-3);
  }

  .form-actions__buttons {
    flex-direction: column;
    align-items   : stretch;
  }

  .form-actions__submit,
  .form-actions__cancel {
    width          : 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .form-page-header__title {
    font-size: var(--text-xl);
  }

  .form-section__legend {
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--text-sm);
  }

  .form-section > *:not(.form-section__legend) {
    padding: var(--sp-3);
  }

  .form-success__inner {
    padding: var(--sp-8) var(--sp-5);
  }
}


/* ============================================================
   MATERIAL PICKER WIDGET
   ============================================================ */

/* ── Input row: search + qty + button ── */
.mat-input-row {
  display    : flex;
  align-items: stretch;
  gap        : var(--sp-3);
  flex-wrap  : wrap;
}

.mat-input-wrap {
  position : relative;
  flex      : 1;
  min-width : 200px;
}

.mat-input-icon {
  position       : absolute;
  left           : var(--sp-3);
  top            : 50%;
  transform      : translateY(-50%);
  font-size      : var(--text-base);
  color          : var(--ink-muted);
  pointer-events : none;
  user-select    : none;
}

.mat-search-input {
  padding-left: calc(var(--sp-3) + 1.4em + var(--sp-2));
  width       : 100%;
}

/* Quantity input — compact */
.mat-qty-wrap {
  flex-shrink: 0;
  width      : 110px;
}

.mat-qty-input {
  font-family: var(--font-mono);
  font-size  : var(--text-sm);
  width      : 100%;
  text-align : center;
}

/* Add button */
.mat-add-btn {
  flex-shrink: 0;
  white-space: nowrap;
  align-self : stretch;
  padding-inline: var(--sp-5);
}


/* ── Tag area ── */
.mat-tag-area {
  padding       : var(--sp-4) var(--sp-6);
  border-top    : 1px dashed var(--border);
  min-height    : 80px;
  display       : flex;
  flex-direction: column;
  gap           : var(--sp-3);
}

/* Empty state */
.mat-empty-state {
  display    : flex;
  align-items: center;
  gap        : var(--sp-3);
  color      : var(--ink-faint);
  font-family: var(--font-mono);
  font-size  : var(--text-sm);
  font-style : italic;
  padding    : var(--sp-4) 0;
}

.mat-empty-state__icon {
  font-size  : var(--text-xl);
  opacity    : 0.5;
  flex-shrink: 0;
}

/* Tag list */
.mat-tag-list {
  list-style : none;
  display    : flex;
  flex-wrap  : wrap;
  gap        : var(--sp-2);
  align-items: flex-start;
}

/* Individual tag pill */
.mat-tag {
  display       : inline-flex;
  align-items   : center;
  gap           : var(--sp-2);
  background    : var(--paper-dark);
  border        : 1.5px solid var(--border);
  border-radius : var(--radius-pill);
  padding       : var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-3);
  box-shadow    : 1px 1px 0 var(--border);
  transition    :
    background-color var(--dur-fast) var(--ease-out),
    border-color     var(--dur-fast) var(--ease-out),
    box-shadow       var(--dur-fast) var(--ease-out);
}

.mat-tag:hover {
  background-color: var(--accent-yellow);
  border-color    : var(--border-strong);
}

.mat-tag__inner {
  display    : flex;
  align-items: center;
  gap        : var(--sp-2);
}

.mat-tag__qty {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  font-weight   : 700;
  color         : var(--badge-kolay-ink);
  background    : var(--badge-kolay-bg);
  border        : 1px solid var(--badge-kolay-border);
  border-radius : var(--radius-sm);
  padding       : 1px 6px;
  flex-shrink   : 0;
  white-space   : nowrap;
}

.mat-tag__name {
  font-family: var(--font-body);
  font-size  : var(--text-sm);
  color      : var(--ink);
  line-height: 1.2;
}

/* Remove (×) button inside tag */
.mat-tag__remove {
  display         : inline-flex;
  align-items     : center;
  justify-content : center;
  width           : 22px;
  height          : 22px;
  border          : none;
  border-radius   : 50%;
  background      : transparent;
  color           : var(--ink-secondary);
  font-size       : 1rem;
  line-height     : 1;
  cursor          : pointer;
  flex-shrink     : 0;
  transition      :
    background-color var(--dur-fast) var(--ease-out),
    color            var(--dur-fast) var(--ease-out);
}

.mat-tag__remove:hover {
  background-color: var(--badge-zor-bg);
  color           : var(--badge-zor-ink);
}

.mat-tag__remove:focus-visible {
  outline       : 2px dashed var(--ink);
  outline-offset: 2px;
}


/* ── Summary bar ── */
.mat-summary-bar {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  padding        : var(--sp-2) var(--sp-6);
  border-top     : 1px dashed var(--border);
  background     : rgba(255,255,255,0.40);
}

.mat-summary-bar__text {
  font-family: var(--font-mono);
  font-size  : var(--text-xs);
  color      : var(--ink-secondary);
  letter-spacing: 0.03em;
}

.mat-clear-btn {
  font-size   : var(--text-xs);
  color       : var(--ink-muted);
  padding     : var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
}
.mat-clear-btn:hover {
  color           : var(--badge-zor-ink);
  background-color: var(--badge-zor-bg);
}

/* Legend count badge */
.form-section__legend-count {
  font-size  : var(--text-xs);
  font-weight: 400;
  color      : var(--ink-muted);
  margin-left: var(--sp-1);
}

/* ── Responsive ── */
@media (max-width: 540px) {
  .mat-input-row {
    flex-direction: column;
    gap: var(--sp-2);
  }
  .mat-qty-wrap  { width: 100%; }
  .mat-add-btn   { width: 100%; justify-content: center; }
  .mat-input-wrap{ min-width: unset; }
}


/* ============================================================
   CUSTOM AUTOCOMPLETE DROPDOWN
   Replaces native <datalist> which suppresses dynamically-
   added options in Chrome, Firefox, and Safari.
   ============================================================ */

/* Anchor point — the input wrapper must be relative */
#mat-autocomplete-wrap {
  position: relative;
}

/* The dropdown list itself */
.mat-suggestions {
  position     : absolute;
  top          : calc(100% + 4px);
  left         : 0;
  right        : 0;
  z-index      : 200;

  background   : var(--paper);
  border       : 2px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow   : 4px 6px 0 var(--border-strong),
                 0 8px 24px rgba(30,20,10,.14);

  list-style   : none;
  margin       : 0;
  padding      : var(--sp-1) 0;
  max-height   : 260px;
  overflow-y   : auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.mat-suggestions[hidden] { display: none; }

/* Individual suggestion row */
.mat-suggestion-item {
  display         : flex;
  align-items     : center;
  justify-content : space-between;
  gap             : var(--sp-3);
  padding         : var(--sp-2) var(--sp-4);
  cursor          : pointer;
  transition      : background-color 80ms ease;
  border-bottom   : 1px solid var(--paper-shadow);
  user-select     : none;
}
.mat-suggestion-item:last-child {
  border-bottom: none;
}
.mat-suggestion-item:hover,
.mat-suggestion-item--active {
  background-color: var(--accent-yellow);
}

.mat-sugg-name {
  font-family : var(--font-body);
  font-size   : var(--text-sm);
  color       : var(--ink);
  font-weight : 500;
  flex        : 1;
  min-width   : 0;
  overflow    : hidden;
  text-overflow: ellipsis;
  white-space : nowrap;
}

.mat-sugg-cat {
  font-family   : var(--font-mono);
  font-size     : var(--text-xs);
  color         : var(--ink-muted);
  background    : var(--paper-dark);
  border        : 1px solid var(--border);
  border-radius : var(--radius-pill);
  padding       : 1px 8px;
  white-space   : nowrap;
  flex-shrink   : 0;
}

/* Responsive */
@media (max-width: 480px) {
  .mat-suggestions { max-height: 200px; }
  .mat-sugg-cat    { display: none; }
}


/* ============================================================
   COMPONENTS PAGE
   ============================================================ */

/* ── Page header ────────────────────────────────────────── */
.comp-page-header {
  padding: var(--sp-12) 0 var(--sp-8);
  border-bottom: 2px solid var(--border);
}
.comp-page-header__inner {
  max-width: 680px;
}
.comp-page-header__title {
  font-size: var(--text-3xl);
  margin: var(--sp-2) 0 var(--sp-3);
}
.comp-page-header__sub {
  color: var(--ink-secondary);
  font-size: var(--text-base);
  line-height: 1.7;
}

/* ── Two-column layout ──────────────────────────────────── */
.comp-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: var(--sp-10);
  padding-top: var(--sp-8);
  padding-bottom: var(--sp-20);
  align-items: start;
}
@media (max-width: 860px) {
  .comp-layout {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
}

/* ── Sidebar ────────────────────────────────────────────── */
.comp-sidebar {
  position: sticky;
  top: calc(60px + var(--sp-6));
}
.comp-sidebar__search {
  margin-bottom: var(--sp-5);
}
.comp-sidebar__heading {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: var(--sp-2);
  padding-left: var(--sp-2);
}
.comp-cat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.comp-cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--ink-secondary);
  background: none;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition:
    background     var(--dur-base) var(--ease-out),
    color          var(--dur-base) var(--ease-out),
    border-color   var(--dur-base) var(--ease-out);
}
.comp-cat-btn:hover {
  background: var(--paper-dark);
  color: var(--ink);
}
.comp-cat-btn--active {
  background: var(--accent-yellow);
  color: var(--ink);
  font-weight: 600;
  border-color: var(--border-strong);
}
.comp-cat-btn__count {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  background: var(--paper-shadow);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  font-weight: 400;
  min-width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}
.comp-cat-btn--active .comp-cat-btn__count {
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink-secondary);
}

/* ── Main area ──────────────────────────────────────────── */
.comp-main__header {
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 1.5px solid var(--border);
}
.comp-main__title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Component card grid ────────────────────────────────── */
.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-5);
}

/* ── Comp-card detail button: prevent last-char clipping ── */
.comp-card__detail-btn {
  white-space: nowrap;
  /* Shift shadow inward so it doesn't get clipped by card's overflow:hidden */
  box-shadow: -2px 2px 0 var(--ink-secondary) !important;
  /* Extra right clearance */
  padding-right: 14px !important;
  flex-shrink: 0;
}
.comp-card__detail-btn:hover {
  box-shadow: -4px 4px 0 var(--ink) !important;
  transform: translate(1px, -1px) !important;
}

/* ── Component card ─────────────────────────────────────── */
@keyframes compCardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.comp-card {
  background: var(--paper);
  border: 2px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  animation: compCardIn 0.4s var(--ease-out) both;
  transition:
    transform    var(--dur-base) var(--ease-out),
    box-shadow   var(--dur-base) var(--ease-out),
    border-left-color var(--dur-base) var(--ease-out);
}
.comp-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-left-color: var(--ink);
}

.comp-card__body {
  padding: var(--sp-4) var(--sp-5) var(--sp-3);
  flex: 1;
}
.comp-card__category {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  margin-bottom: var(--sp-2);
}
.comp-card__title {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: var(--sp-2);
}
.comp-card__desc {
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  line-height: 1.6;
}
.comp-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1.5px solid var(--border);
  background: var(--paper-dark);
}
.comp-card__proj-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
}
.comp-card__proj-count--none {
  font-style: italic;
  opacity: 0.7;
}

/* ── Modal overlay ──────────────────────────────────────── */
@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.comp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 42, 56, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: var(--sp-4);
  backdrop-filter: blur(3px);
  animation: overlayIn 0.2s var(--ease-out) both;
}
.comp-modal-overlay[hidden] {
  display: none;
}

.comp-modal {
  background: var(--paper);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideUp 0.28s var(--ease-spring) both;
}

/* Close button — sticky top-right */
.comp-modal__close {
  position: sticky;
  top: var(--sp-4);
  float: right;
  margin: var(--sp-4) var(--sp-4) 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--paper-dark);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--ink-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 10;
  transition:
    background    var(--dur-fast) var(--ease-out),
    border-color  var(--dur-fast) var(--ease-out),
    color         var(--dur-fast) var(--ease-out);
}
.comp-modal__close:hover {
  background: var(--accent-red);
  border-color: var(--badge-zor-border);
  color: var(--ink);
}

.comp-modal__header {
  padding: var(--sp-4) var(--sp-6) var(--sp-4);
  /* clear: right keeps header below the floated close button */
  clear: right;
}
.comp-modal__category-badge {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  margin-bottom: var(--sp-2);
}
.comp-modal__title {
  font-size: var(--text-2xl);
  line-height: 1.2;
}

.comp-modal__body {
  padding: 0 var(--sp-6) var(--sp-8);
}
.comp-modal__section {
  margin-bottom: var(--sp-6);
}
.comp-modal__section[hidden] {
  display: none;
}
.comp-modal__section-heading {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: var(--sp-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.comp-modal__description {
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  line-height: 1.8;
}
.comp-modal__datasheet-btn {
  font-size: var(--text-sm);
}

/* Related projects list */
.comp-modal__project-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.comp-modal__project-item {
  list-style: none;
}
.comp-modal__project-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--paper-dark);
  text-decoration: none;
  color: inherit;
  transition:
    background    var(--dur-base) var(--ease-out),
    border-color  var(--dur-base) var(--ease-out),
    transform     var(--dur-fast) var(--ease-spring);
}
.comp-modal__project-link:hover {
  background: var(--accent-blue);
  border-color: var(--border-strong);
  transform: translateX(4px);
}
.comp-modal__proj-title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  flex: 1;
}
.comp-modal__proj-arrow {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}
.comp-modal__no-projects {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  font-style: italic;
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}


/* ============================================================
   SOCIAL: TOP MAKERS STRIP
   ============================================================ */

.top-makers {
  padding: var(--sp-6) 0;
  border-bottom: 2px solid var(--border);
  background: var(--paper-dark);
}
.top-makers__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
}
.top-makers__label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
  flex-shrink: 0;
}
.top-makers__list {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  flex: 1;
}

/* Maker card */
.maker-card {
  list-style: none;
}
.maker-card__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  color: inherit;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  transition:
    background     var(--dur-base) var(--ease-out),
    border-color   var(--dur-base) var(--ease-out),
    transform      var(--dur-fast) var(--ease-spring);
}
.maker-card__link:hover {
  background: var(--paper);
  border-color: var(--border);
  transform: translateY(-2px);
}
.maker-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
  transition: border-color var(--dur-base) var(--ease-out);
}
.maker-card__link:hover .maker-card__avatar {
  border-color: var(--ink);
}
.maker-card__name {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.maker-card__meta {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  text-align: center;
  white-space: nowrap;
}


/* ============================================================
   SOCIAL: PROFILE PAGE
   ============================================================ */

.profile-main {
  padding-top: var(--sp-8);
  padding-bottom: var(--sp-20);
}

/* ── Profile hero ─────────────────────────────────────── */
.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-8);
  align-items: start;
  margin-bottom: var(--sp-8);
}
@media (max-width: 600px) {
  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

/* Large profile avatar */
.profile-avatar-wrap {
  flex-shrink: 0;
}
.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--ink);
  background: var(--accent-yellow);
  box-shadow: var(--shadow-md);
}

/* Info block */
.profile-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.profile-info__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.profile-info__names {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.profile-info__display-name {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}
.profile-info__username {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}
.profile-info__role {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  background: var(--paper-dark);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
}
.profile-info__bio {
  color: var(--ink-secondary);
  font-size: var(--text-base);
  line-height: 1.7;
  max-width: 560px;
}

/* Stats strip */
.profile-stats {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.profile-stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-3) var(--sp-5);
  gap: var(--sp-1);
}
.profile-stats__value {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.profile-stats__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.profile-stats__divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .profile-stats { justify-content: center; }
}

/* ── Follow button states ─────────────────────────────── */
.profile-follow-btn {
  min-width: 120px;
  justify-content: center;
}
.profile-follow-btn--following {
  border-color: var(--badge-kolay-border);
  color: var(--badge-kolay-ink);
}
.profile-follow-btn--following:hover {
  background: var(--accent-red);
  border-color: var(--badge-zor-border);
  color: var(--badge-zor-ink);
}

/* ── Profile tabs ─────────────────────────────────────── */
.profile-tabs {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-8);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.profile-tab {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color var(--dur-base), border-color var(--dur-base);
  white-space: nowrap;
}

.profile-tab:hover {
  color: var(--ink);
}

.profile-tab--active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.profile-tab .detail-section__number {
  font-size: 10px;
  opacity: 0.5;
}

/* ── Profile projects section ─────────────────────────── */
.profile-projects-section {
  margin-top: var(--sp-6);
}

.profile-projects-count,
.profile-liked-count {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--ink-muted);
  margin-left: var(--sp-1);
}

/* ── Likes button liked state ─────────────────────────── */
.likes-btn--liked {
  color: #e53e3e;
}
.likes-btn--liked .likes-btn__icon {
  filter: none;
}


/* ============================================================
   DYNAMIC HEADER — User State Widget
   ============================================================ */
.header-user {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.header-user-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  transition:
    color        var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    background   var(--dur-base) var(--ease-out);
}
.header-user-link:hover {
  color: var(--ink);
  border-color: var(--border);
  background: var(--paper-dark);
}
.header-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
  transition: border-color var(--dur-base) var(--ease-out);
}
.header-user-link:hover .header-avatar {
  border-color: var(--ink);
}
.header-user-label {
  font-size: var(--text-sm);
}
.header-login-btn {
  font-size: var(--text-xs);
  padding: 0.4rem 0.9rem;
}

@media (max-width: 480px) {
  .header-user-label { display: none; }
  .header-avatar { width: 28px; height: 28px; }
}


/* ============================================================
   BOOKMARK BUTTON
   ============================================================ */
@keyframes bookmarkBounce {
  0%  { transform: scale(1);    }
  35% { transform: scale(1.5);  }
  65% { transform: scale(0.88); }
  85% { transform: scale(1.12); }
  100%{ transform: scale(1);    }
}

.bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  transition:
    background    var(--dur-fast) var(--ease-out),
    border-color  var(--dur-fast) var(--ease-out),
    color         var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}
.bookmark-btn:hover {
  background: var(--accent-yellow);
  border-color: var(--border-strong);
  color: var(--ink);
}
.bookmark-btn--saved {
  background: var(--accent-yellow);
  border-color: var(--border-strong);
  color: var(--ink);
}
.bookmark-btn--saved:hover {
  background: var(--accent-red);
  border-color: var(--badge-zor-border);
}
.bookmark-btn__icon {
  font-size: 0.85em;
  line-height: 1;
  transition: transform var(--dur-fast) var(--ease-spring);
}
.bookmark-btn--bounce .bookmark-btn__icon {
  animation: bookmarkBounce 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
/* Detail page variant — shows text label */
.detail-bookmark-btn {
  padding: 0.5rem 0.9rem;
  font-size: var(--text-sm);
}


/* ============================================================
   MOBILE RESPONSIVE FIXES
   ============================================================ */

/* ── Top Makers: horizontal scroll on small screens ──── */
@media (max-width: 600px) {
  .top-makers__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
  }
  .top-makers__list {
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
    padding-bottom: var(--sp-2);
    /* Custom scrollbar hint */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }
  .maker-card__link {
    min-width: 80px;
  }
}

/* ── Stats bar: fix dividers at 768px ──────────────────── */
@media (max-width: 768px) {
  .stats-item {
    padding-inline: var(--sp-6);
  }
}

/* ── Cards grid: hard single-column at 400px ───────────── */
@media (max-width: 400px) {
  .cards-wrapper {
    grid-template-columns: 1fr;
  }
  .comp-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Profile: tighter layout on mobile ─────────────────── */
@media (max-width: 480px) {
  .profile-hero {
    gap: var(--sp-5);
  }
  .profile-avatar {
    width: 80px;
    height: 80px;
    font-size: var(--text-xl);
  }
  .profile-info__display-name {
    font-size: var(--text-xl);
  }
  .profile-stats__item {
    padding: var(--sp-2) var(--sp-3);
  }
  .profile-stats__value {
    font-size: var(--text-lg);
  }
  .profile-info__top {
    flex-direction: column;
    gap: var(--sp-3);
  }
}

/* ── Filter bar: prevent overflow on very small screens ── */
@media (max-width: 400px) {
  .filter-bar__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .filter-list {
    width: 100%;
  }
}

/* ── Components layout already collapses at 860px ─────── */
/* Extra fix: sidebar stacks above grid on mobile */
@media (max-width: 860px) {
  .comp-sidebar {
    position: static; /* un-stick when stacked */
  }
}

/* ── Header: keep user widget inline at all breakpoints ── */
@media (max-width: 768px) {
  .header-user {
    order: 2; /* sits between logo (order 1) and nav (order 3) */
    flex-shrink: 0;
  }
}

/* ==================================================================
   ★  FEATURE STYLES — all new features added after the original CSS.
      These rules are intentionally at the end so they always win
      specificity ties against any earlier duplicates.
================================================================== */


/* ── Scrolled-header shadow — toggled by app.js / site.js ──────── */
.site-header--scrolled {
  box-shadow:
    0 2px 0 0 var(--paper-dark),
    0 3px 0 0 var(--ink),
    0 6px 28px rgba(60, 50, 30, 0.18) !important;
}


/* ── Likes bounce animation (was JS-injected, now static CSS) ───── */
@keyframes likesBounce {
  0%   { transform: scale(1);    }
  35%  { transform: scale(1.55); }
  65%  { transform: scale(0.88); }
  85%  { transform: scale(1.15); }
  100% { transform: scale(1);    }
}
.likes-btn--bounce .likes-btn__icon {
  animation: likesBounce 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}


/* ── Card entrance animation (replaces the fragile opacity-0/IntersectionObserver approach).
      Cards animate in on every render — filters included — without depending on async IO. ── */
/* cardReveal keyframe retained for legacy card--animate class */
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(18px) rotate(var(--card-rotate, 0deg)); }
  to   { opacity: 1; transform: translateY(0)    rotate(var(--card-rotate, 0deg)); }
}
/* NOTE: animation is NOT on .project-card base — only on .card--animate class */


/* ============================================================
   CATEGORY CAROUSEL
   ============================================================ */
.category-carousel {
  background: var(--paper-dark);
  border-bottom: 1.5px solid var(--border);
  padding: var(--sp-4) 0;
  /* Clip to prevent any oversized pill from causing page overflow */
  overflow: hidden;
}
.category-carousel__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.category-carousel__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  white-space: nowrap;
}
.category-track {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 3px; /* prevent shadow clip */
  list-style: none;
}
.category-track::-webkit-scrollbar { display: none; }

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--ink-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background    var(--dur-base) var(--ease-out),
    border-color  var(--dur-base) var(--ease-out),
    color         var(--dur-base) var(--ease-out),
    transform     var(--dur-fast) var(--ease-spring),
    box-shadow    var(--dur-base) var(--ease-out);
}
.cat-pill:hover {
  background: var(--paper);
  border-color: var(--border-strong);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.cat-pill--active {
  background: var(--accent-yellow);
  border-color: var(--border-strong);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.cat-pill__emoji {
  font-size: 1em;
  line-height: 1;
}

@media (max-width: 768px) {
  .category-carousel__inner {
    gap: var(--sp-3);
  }
  .category-track {
    /* Ensure track never wider than the viewport */
    max-width: calc(100vw - 2 * var(--container-pad));
  }
}
@media (max-width: 600px) {
  .category-carousel__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
  }
  .category-track {
    width: 100%;
    max-width: 100%;
  }
}


/* ============================================================
   PROJECTS GRID — TWO-COLUMN LAYOUT
   ============================================================ */
.projects-grid__layout {
  display: grid;
  /* minmax(0,1fr) prevents the main column from blowing out the grid */
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: var(--sp-6);
  align-items: start;
}
.projects-grid__main {
  min-width: 0;
  /* Clip only horizontal overflow; vertical must stay visible for sticky sub-headers */
  overflow-x: hidden;
  overflow-y: visible;
}

@media (max-width: 1100px) {
  .projects-grid__layout {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: var(--sp-5);
  }
}
@media (max-width: 860px) {
  .projects-grid__layout {
    grid-template-columns: 1fr;
  }
  .activity-sidebar {
    /* Shown as a full-width block under the grid on narrow screens */
    display: block;
    position: static;
    max-height: none;
    border-top: 2px solid var(--border);
    padding-top: var(--sp-6);
    margin-top: var(--sp-6);
  }
}


/* ============================================================
   COMPONENT OF THE WEEK SPOTLIGHT
   ============================================================ */
.component-spotlight {
  margin-bottom: var(--sp-6);
}
.comp-spotlight-card {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-5);
  padding: var(--sp-5) var(--sp-6);
  background: linear-gradient(125deg, var(--accent-yellow) 0%, var(--accent-orange) 100%);
  border: 2px solid var(--border-strong);
  border-left: 5px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
/* Faint watermark text */
.comp-spotlight-card::after {
  content: 'SPOTLIGHT';
  position: absolute;
  bottom: var(--sp-3);
  right: var(--sp-4);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(30, 42, 56, 0.12);
  pointer-events: none;
  user-select: none;
}
.comp-spotlight-deco {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.comp-spotlight-info {
  flex: 1;
  min-width: 0;
}
.comp-spotlight-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}
.comp-spotlight-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
}
.comp-spotlight-cat {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-secondary);
}
.comp-spotlight-name {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: var(--sp-2);
}
.comp-spotlight-desc {
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  line-height: 1.65;
  margin-bottom: var(--sp-4);
}
.comp-spotlight-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.spotlight-btn {
  font-size: var(--text-xs);
}

@media (max-width: 520px) {
  .comp-spotlight-card {
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-4);
  }
  .comp-spotlight-deco { font-size: 1.6rem; }
  .comp-spotlight-name { font-size: var(--text-lg); }
}


/* ============================================================
   LIVE ACTIVITY FEED SIDEBAR
   ============================================================ */
.activity-sidebar {
  position: sticky;
  /* 73px header + ~87px filter-bar = 160px; +16px breathing room = 176px */
  top: 176px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding-right: var(--sp-1);
}
.activity-sidebar::-webkit-scrollbar {
  width: 4px;
}
.activity-sidebar::-webkit-scrollbar-track { background: transparent; }
.activity-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.activity-sidebar__header {
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-1);
  border-bottom: 2px solid var(--ink);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 1;
  /* match the grid paper background */
  background-image:
    linear-gradient(var(--grid-line-h) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-h) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}
.activity-sidebar__title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* Timeline feed */
.activity-feed {
  list-style: none;
  position: relative;
  padding-top: var(--sp-2);
}
/* The vertical timeline line */
.activity-feed::before {
  content: '';
  position: absolute;
  left: 13px;
  top: var(--sp-4);
  bottom: var(--sp-4);
  width: 2px;
  background: var(--border);
}

.activity-item {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) 0 var(--sp-3) var(--sp-2);
  position: relative;
  animation: activityFadeIn 0.35s var(--ease-out) both;
}
@keyframes activityFadeIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Colored dot on the timeline line */
.activity-item::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2.5px solid var(--border);
  z-index: 1;
  box-sizing: border-box;
}
.activity-item[data-type="project"]::before   { border-color: var(--badge-kolay-border); background: var(--badge-kolay-bg); }
.activity-item[data-type="like"]::before      { border-color: var(--badge-zor-border);   background: var(--accent-red);    }
.activity-item[data-type="follow"]::before    { border-color: var(--badge-orta-border);  background: var(--badge-orta-bg); }
.activity-item[data-type="bookmark"]::before  { border-color: var(--border-strong);      background: var(--accent-yellow); }
.activity-item[data-type="component"]::before { border-color: var(--ink-muted);          background: var(--paper-shadow);  }

.activity-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
  margin-left: var(--sp-4); /* push right of the timeline dot */
}
.activity-content {
  flex: 1;
  min-width: 0;
}
.activity-text {
  font-size: var(--text-xs);
  color: var(--ink-secondary);
  line-height: 1.55;
  word-break: break-word;
}
.activity-user {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink);
}
.activity-target {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-secondary);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 120px;
  vertical-align: middle;
}
.activity-time {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-faint);
  margin-top: 3px;
}


/* ============================================================
   CARD IMAGES  (project cards + component cards)
   ============================================================ */
.card-image-wrap {
  width: 100%;
  height: 170px;
  overflow: hidden;
  border-bottom: 1.5px solid var(--border);
  background: var(--paper-dark);
  flex-shrink: 0;
}
.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s var(--ease-out);
}
.project-card:hover .card-image,
.comp-card:hover     .card-image {
  transform: scale(1.04);
}
/* Keep card image from disrupting the notebook margin layout */
.project-card .card-image-wrap {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.comp-card .card-image-wrap {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}


/* ============================================================
   COMPONENT CARD — mobile button fix
   ============================================================ */
@media (max-width: 520px) {
  .comp-card__footer {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-2);
  }
  .comp-card__detail-btn {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    word-break: break-word;
    white-space: normal;
  }
}


/* ============================================================
   PROJECTS GRID — sidebar removed; main column is full width
   ============================================================ */
/* The .projects-grid__layout selector is now unused — override
   any lingering two-column declaration to be safe. */
.projects-grid__layout,
.projects-grid__main {
  display: block;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: visible;
}

/* Activity sidebar is gone — hide any stale DOM node gracefully */
.activity-sidebar { display: none !important; }


/* ============================================================
   DARK THEME SUPPORT
   Sleek dark palette for comfortable evening/night viewing
   ============================================================ */
body.dark-theme {
  /* Dark paper background with subtle grid overlay */
  --paper:          #0f1419;
  --paper-dark:     #1a1f28;
  --paper-shadow:   #2a3038;
  --grid-line:      rgba(60, 90, 130, 0.25);
  --grid-line-h:    rgba(50, 70, 110, 0.15);
  --margin-line:    rgba(220, 100, 100, 0.15);

  /* Light ink colors for dark background */
  --ink:            #e8ecf1;
  --ink-secondary:  #b8c4d0;
  --ink-muted:      #7a8899;
  --ink-faint:      #5a6878;

  /* Brighter, more saturated accents for dark mode */
  --accent-yellow:  #ffd700;
  --accent-green:   #6fbf73;
  --accent-blue:    #60b0e0;
  --accent-red:     #ff6b6b;
  --accent-orange:  #ffb74d;

  /* Badge colors adjusted for dark theme */
  --badge-kolay-bg:   #1e4d2b;
  --badge-kolay-ink:  #6eff7f;
  --badge-kolay-border: #4a9d5a;
  --badge-orta-bg:    #4d3a1f;
  --badge-orta-ink:   #ffc966;
  --badge-orta-border: #e0a040;
  --badge-zor-bg:     #4d1f1f;
  --badge-zor-ink:    #ff8080;
  --badge-zor-border: #d04040;

  /* UI Chrome for dark mode */
  --border:         #2a3840;
  --border-strong:  #3a4855;
  --shadow-sm:      0 2px 8px rgba(0, 0, 0, 0.40);
  --shadow-md:      0 4px 16px rgba(0, 0, 0, 0.50);
  --shadow-card:    0 3px 20px rgba(0, 0, 0, 0.45),
                    0 1px 3px rgba(0, 0, 0, 0.30);
  --shadow-lift:    0 6px 32px rgba(0, 0, 0, 0.60);
}

/* Smooth theme transition */
body {
  transition: background-color var(--dur-base), color var(--dur-base);
}

body * {
  transition: background-color var(--dur-base), color var(--dur-base), border-color var(--dur-base);
}


/* ============================================================
   DARK MODE TOGGLE BUTTON
   ============================================================ */
.btn--theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  cursor: pointer;
  font-size: 1.2em;
  line-height: 1;
  transition: all var(--dur-base) var(--ease-out);
}

.btn--theme-toggle:hover {
  border-color: var(--ink-secondary);
  background-color: var(--paper-dark);
}

.btn--theme-toggle:active {
  transform: scale(0.95);
}

body.dark-theme .btn--theme-toggle {
  border-color: var(--border);
}

body.dark-theme .btn--theme-toggle:hover {
  border-color: var(--accent-yellow);
  background-color: var(--paper-dark);
}

/* Icon swap for dark mode */
.btn--icon-only {
  font-size: 1.1em;
}

/* ============================================================
   CARD SCROLL-REVEAL
   Cards start visible. JS adds .card--animate for the entrance
   animation on initial load (not on filter re-renders).
   ============================================================ */
.project-card {
  opacity: 1;
  transform: rotate(var(--card-rotate, 0deg));
}
.project-card.card--animate {
  animation: cardRevealIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes cardRevealIn {
  from { opacity: 0; transform: translateY(14px) rotate(var(--card-rotate, 0deg)); }
  to   { opacity: 1; transform: translateY(0)    rotate(var(--card-rotate, 0deg)); }
}



/* ── Anti-FOIT: applied to <html> tag before body class is set ── */
html.dark-theme-loading {
  background-color: #0f1419;
  color: #e8ecf1;
}
html.dark-theme-loading body {
  background-color: #0f1419;
}

/* ============================================================
   DARK THEME — Component overrides
   All dark-mode specific styling that cannot be handled by
   CSS custom properties alone (backgrounds with gradients,
   box-shadows, etc.)
   ============================================================ */

/* Graph paper — re-declare background-image using updated CSS vars */
body.dark-theme {
  background-image:
    linear-gradient(90deg, transparent 71px, var(--margin-line) 71px,
      var(--margin-line) 73px, transparent 73px),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-h) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-h) 1px, transparent 1px);
  background-size:
    100% 100%,
    calc(var(--grid-size) * 4) calc(var(--grid-size) * 4),
    calc(var(--grid-size) * 4) calc(var(--grid-size) * 4),
    var(--grid-size) var(--grid-size),
    var(--grid-size) var(--grid-size);
  color-scheme: dark;
}

/* Site header */
body.dark-theme .site-header {
  background-color: #0d1117;
  background-image:
    linear-gradient(var(--grid-line-h) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-h) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  border-bottom: 3px solid var(--border-strong);
  box-shadow: 0 2px 0 0 #1a1f28, 0 3px 0 0 var(--border-strong),
              0 5px 18px rgba(0,0,0,0.4);
}

/* Hero section */
body.dark-theme .hero-section {
  background: transparent;
}
body.dark-theme .hero-headline__accent::after {
  background-color: rgba(255,215,0,0.25);
}
body.dark-theme .hero-notebook-doodle {
  background-color: rgba(26,31,44,0.8);
  border-color: var(--border);
}

/* Stats bar */
body.dark-theme .stats-bar {
  background-color: #080c12;
  border-color: var(--border-strong);
}

/* Filter bar */
body.dark-theme .filter-bar {
  background-color: #0d1117;
  background-image:
    linear-gradient(var(--grid-line-h) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-h) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  border-bottom-color: var(--border);
}
body.dark-theme .filter-btn {
  background-color: #1a1f28;
  border-color: var(--border);
  color: var(--ink-secondary);
}
body.dark-theme .filter-btn:hover {
  background-color: var(--paper-shadow);
  color: var(--ink);
}
body.dark-theme .filter-btn--active,
body.dark-theme .filter-btn[aria-pressed="true"] {
  background-color: var(--paper-dark);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: 0 -2px 0 0 var(--accent-yellow);
}
body.dark-theme .search-input {
  background-color: #1a1f28;
  color: var(--ink);
  border-color: var(--border);
}
body.dark-theme .search-input::placeholder { color: var(--ink-faint); }
body.dark-theme .search-input:focus {
  background-color: var(--paper-dark);
  border-color: var(--border-strong);
  box-shadow: 3px 3px 0 var(--border);
}

/* Project cards */
body.dark-theme .project-card {
  background-color: #131720;
  border-color: var(--border);
}
body.dark-theme .project-card:hover {
  box-shadow: 0 6px 32px rgba(0,0,0,0.6);
}
body.dark-theme .project-card__body {
  background-color: transparent;
  background-image: linear-gradient(rgba(60,90,130,0.12) 1px, transparent 1px);
  background-size: 100% var(--grid-size);
}
body.dark-theme .project-card__footer {
  background-color: rgba(13,17,23,0.5);
  border-top-color: var(--border);
}
body.dark-theme .project-card__notebook-margin {
  background-color: rgba(180,60,60,0.05);
  border-right-color: rgba(200,80,80,0.15);
}
/* Tape strip on cards */
body.dark-theme .project-card::before {
  background-color: rgba(255,215,0,0.15);
  border-color: rgba(200,160,40,0.20);
}
body.dark-theme .project-card:nth-child(even)::before {
  background-color: rgba(96,176,224,0.12);
  border-color: rgba(80,140,190,0.15);
}

/* Tags */
body.dark-theme .tag {
  background-color: #1a1f28;
  border-color: var(--border);
  color: var(--ink-secondary);
}

/* Buttons */
body.dark-theme .btn--primary {
  background-color: var(--accent-yellow);
  color: #0d1117;
  border-color: var(--accent-yellow);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
}
body.dark-theme .btn--primary:hover {
  box-shadow: 5px 5px 0 rgba(0,0,0,0.5);
}
body.dark-theme .btn--secondary {
  background-color: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: 3px 3px 0 var(--border);
}
body.dark-theme .btn--inspect {
  background-color: var(--ink);
  color: #0d1117;
  border-color: var(--ink);
  box-shadow: 2px 2px 0 rgba(255,255,255,0.1);
}
body.dark-theme .btn--inspect:hover {
  background-color: var(--accent-yellow);
  color: #0d1117;
  border-color: var(--accent-yellow);
}

/* CTA strip */
body.dark-theme .cta-strip {
  background-color: #080c12;
}
body.dark-theme .cta-strip::before {
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
}
body.dark-theme .cta-strip .btn--primary {
  background-color: var(--accent-yellow);
  color: #080c12;
  border-color: var(--accent-yellow);
}

/* Footer */
body.dark-theme .site-footer {
  background-color: #0d1117;
  border-top-color: var(--border-strong);
}

/* Likes button */
body.dark-theme .likes-btn:hover {
  background-color: rgba(255,107,107,0.2);
  color: var(--accent-red);
}

/* Header nav links */
body.dark-theme .header-nav__link {
  color: var(--ink-secondary);
}
body.dark-theme .header-nav__link::before {
  background-color: var(--accent-yellow);
}

/* Logo */
body.dark-theme .logo-bracket { color: var(--ink-muted); }

/* No-results */
body.dark-theme .no-results {
  color: var(--ink-secondary);
}

/* Maker cards */
body.dark-theme .maker-card {
  background-color: #131720;
  border-color: var(--border);
}

/* Category pills */
body.dark-theme .cat-pill {
  background-color: #1a1f28;
  border-color: var(--border);
  color: var(--ink-secondary);
}
body.dark-theme .cat-pill:hover {
  background-color: var(--paper-shadow);
  color: var(--ink);
}
body.dark-theme .cat-pill--active {
  background-color: var(--paper-dark);
  color: var(--ink);
  border-color: var(--accent-yellow);
}

/* Component spotlight */
body.dark-theme .comp-spotlight-card {
  background-color: #131720;
  border-color: var(--border);
}

/* Actions row: share button + inspect button side-by-side */
.project-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Inspect button fills remaining space next to share button */
.project-card__actions .btn--inspect {
  flex: 1;
  justify-content: center;
  padding: 0.55rem 1rem;
  width: auto;
}

/* Fallback: when inspect has no sibling (old markup), keep full width */
.project-card .btn--inspect:only-child,
.project-card > .project-card__footer > .btn--inspect {
  width: 100%;
  justify-content: center;
  padding: 0.55rem 1rem;
}


/* ============================================================
   SHARE BUTTON & DROPDOWN
   ============================================================ */

.share-wrap {
  position: relative;
  flex-shrink: 0;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.28rem 0.6rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  white-space: nowrap;
  transition:
    background    var(--dur-fast) var(--ease-out),
    border-color  var(--dur-fast) var(--ease-out),
    color         var(--dur-fast) var(--ease-out);
}

.share-btn:hover,
.share-btn[aria-expanded="true"] {
  background: var(--accent-green, #b2f2bb);
  border-color: var(--border-strong);
  color: var(--ink);
}

.share-dropdown {
  position: absolute;
  /* open upward so it doesn't get clipped by the card bottom */
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 200;
  min-width: 196px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-md, 10px);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: shareDropIn 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes shareDropIn {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)  scale(1);     }
}

/* On the detail page, open downward — there's room above the fold */
#detail-share-wrap .share-dropdown {
  bottom: auto;
  top: calc(100% + 8px);
}

.share-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: calc(var(--radius-md, 10px) - 2px);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  text-align: left;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out);
}

.share-option:hover {
  background: var(--paper-dark);
}

/* Detail page share button */
.detail-share-btn {
  padding: 0.5rem 0.9rem;
  font-size: var(--text-sm);
}

/* Dark-mode tweaks */
body.dark-theme .share-dropdown {
  background: var(--paper-dark);
  border-color: var(--border-strong);
  box-shadow: 4px 4px 0 var(--border-strong);
}

body.dark-theme .share-btn:hover,
body.dark-theme .share-btn[aria-expanded="true"] {
  background: rgba(111, 191, 115, 0.25);
  color: var(--accent-green);
}

body.dark-theme .share-option:hover {
  background: var(--paper-shadow);
}


/* ============================================================
   SHARE TOAST  (bottom-right notification)
   ============================================================ */

.share-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18), 3px 3px 0 rgba(0, 0, 0, 0.12);
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.share-toast--in {
  opacity: 1;
  transform: translateY(0);
}

.share-toast--out {
  opacity: 0;
  transform: translateY(8px);
}

body.dark-theme .share-toast {
  background: var(--ink);
  color: var(--paper-dark);
}


/* ============================================================
   EMPTY STATE  (no search results, no liked projects, etc.)
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 72px 24px;
  width: 100%;
}

.empty-state__icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 20px;
  display: block;
  animation: emptyBounce 2s ease-in-out infinite;
}

@keyframes emptyBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.empty-state__title {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.empty-state__text {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  line-height: 1.65;
  max-width: 360px;
  margin-bottom: 28px;
}

/* Improve the existing #no-results block to use the same visual */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 24px;
}

.no-results__icon {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.no-results__message {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-bottom: 20px;
}


/* ============================================================
   GAMIFICATION BADGE PILL  (profile.html)
   ============================================================ */
.profile-name-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--accent-yellow);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  letter-spacing: 0.02em;
  box-shadow: 2px 2px 0 var(--border-strong);
  white-space: nowrap;
}

body.dark-theme .profile-badge {
  background: var(--accent-yellow);
  color: #0d1117;
  border-color: rgba(255,215,0,0.4);
}


/* ============================================================
   PDF / PRINT BUTTON  (project detail page)
   ============================================================ */
.detail-pdf-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  gap: var(--sp-1);
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .detail-pdf-btn .detail-pdf-btn__label { display: none; }
}


/* ============================================================
   PRINT / PDF  — @media print
   Hides all navigation chrome and styles the project detail
   page as a clean corporate-style lab report.
   ============================================================ */
@media print {

  /* ── 1. Hide everything that isn't the article ─────────── */
  #site-header,
  .detail-breadcrumb,
  #download-pdf-btn,
  #detail-share-wrap,
  .share-toast,
  #detail-likes-btn,
  .detail-header__author-row .likes-btn,
  .code-copy-btn,
  #site-footer,
  #detail-skeleton,
  #detail-not-found,
  .btn--theme-toggle,
  .btn--login-header,
  .btn--add-project,
  #section-comments,
  .filter-bar,
  .hero-section,
  .stats-bar,
  .cta-strip,
  .header-user,
  nav.header-nav,
  #profile-follow-btn {
    display: none !important;
  }

  /* ── 2. Page setup ─────────────────────────────────────── */
  @page {
    size: A4 portrait;
    margin: 18mm 20mm 22mm 20mm;
  }

  /* ── 3. Reset body to clean B&W ────────────────────────── */
  html, body {
    background: #fff !important;
    background-image: none !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.6;
  }

  /* ── 4. Container — full width, no side padding ────────── */
  .container,
  .project-detail {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* ── 5. Print header (report title block) ──────────────── */
  .detail-article {
    display: block !important;
  }

  .detail-header {
    border-bottom: 2px solid #000;
    padding-bottom: 10pt;
    margin-bottom: 16pt;
  }

  .detail-title {
    font-size: 18pt;
    font-weight: 700;
    color: #000 !important;
    margin: 6pt 0 4pt;
  }

  .detail-description {
    font-size: 10.5pt;
    color: #333 !important;
    margin-bottom: 8pt;
  }

  .detail-header__meta {
    font-size: 9pt;
    color: #555 !important;
    margin-bottom: 6pt;
  }

  /* Author row — keep author name, hide like button */
  .detail-header__author-row {
    display: flex;
    gap: 12pt;
    align-items: center;
    margin-top: 8pt;
    font-size: 9.5pt;
    color: #333 !important;
  }

  /* ── 6. Section headings ────────────────────────────────── */
  .detail-rule {
    border: none;
    border-top: 1px solid #888;
    margin: 14pt 0;
  }

  .detail-section__heading {
    font-size: 13pt;
    font-weight: 700;
    color: #000 !important;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4pt;
    margin-bottom: 10pt;
    page-break-after: avoid;
  }

  .detail-section__number {
    font-family: monospace;
    font-size: 10pt;
    color: #666 !important;
    margin-right: 8pt;
  }

  .detail-section__hint {
    display: none;
  }

  /* ── 7. Materials BOM table ─────────────────────────────── */
  .materials-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4pt 16pt;
    page-break-inside: avoid;
  }

  .checklist-item {
    display: flex;
    align-items: baseline;
    gap: 6pt;
    font-size: 10pt;
    border-bottom: 0.5pt solid #ddd;
    padding: 3pt 0;
  }

  .checklist-checkbox { display: none; }

  .checklist-qty {
    font-family: monospace;
    font-weight: 700;
    color: #000 !important;
    min-width: 24pt;
    flex-shrink: 0;
  }

  .checklist-name {
    color: #222 !important;
  }

  /* ── 8. Steps — numbered list ───────────────────────────── */
  .steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .step-item {
    display: block !important;
    padding: 6pt 0 6pt 0;
    border-bottom: 0.5pt solid #ddd;
    page-break-inside: avoid;
    cursor: default;
  }

  .step-item__header {
    display: flex;
    align-items: baseline;
    gap: 8pt;
    margin-bottom: 3pt;
  }

  .step-item__number {
    font-family: monospace;
    font-weight: 700;
    font-size: 10pt;
    color: #000 !important;
  }

  .step-item__title {
    font-size: 10.5pt;
    font-weight: 600;
    color: #000 !important;
  }

  .step-item__done-icon { display: none; }

  .step-item__detail {
    font-size: 10pt;
    color: #333 !important;
    margin: 0 0 0 24pt;
    line-height: 1.55;
  }

  /* ── 9. Code block ──────────────────────────────────────── */
  .code-block-wrapper {
    page-break-before: always;
  }

  .code-block-toolbar {
    background: #eee !important;
    border: 1pt solid #aaa;
    border-bottom: none;
    padding: 4pt 8pt;
    display: flex;
    align-items: center;
    gap: 6pt;
    font-size: 9pt;
    color: #333 !important;
  }

  /* Hide the coloured traffic-light dots */
  .code-block-toolbar__dot { display: none; }

  .code-block {
    background: #f5f5f5 !important;
    border: 1pt solid #aaa;
    padding: 8pt 10pt;
    font-family: "Fira Code", "Courier New", monospace;
    font-size: 8.5pt;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    color: #000 !important;
    overflow: visible !important;
    max-height: none !important;
  }

  /* ── 10. Badges & misc ──────────────────────────────────── */
  .badge {
    border: 1pt solid #888 !important;
    background: transparent !important;
    color: #000 !important;
    font-size: 8pt;
    padding: 1pt 6pt;
  }

  /* Ensure links don't show href noise */
  a[href]::after { content: none !important; }

  /* Prevent orphaned headings */
  h1, h2, h3 { page-break-after: avoid; }
}


/* ============================================================
   TASK 2 — RESPONSIVE HEADER FIXES
   Prevent overflow, ensure logo + controls never overlap.
   ============================================================ */

.site-header {
  /* Hard-cap width so nothing bleeds past viewport */
  max-width: 100vw;
  overflow: visible;
}

.header-inner {
  min-width: 0;          /* allow flex children to shrink */
  gap: 8px;
}

/* On small screens shrink the logo text gracefully */
@media (max-width: 600px) {
  .site-logo {
    font-size: clamp(12px, 3.5vw, 15px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }

  /* Keep right-side controls in a row, never wrap */
  #header-user {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  /* Shrink the "Proje Ekle" CTA so it fits */
  #btn-add-project {
    font-size: 11px;
    padding: 6px 10px;
    white-space: nowrap;
  }
}

/* Prevent any horizontal scrollbar on every page */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}


/* ============================================================
   TASK 3 — DARK MODE TEXT FIXES
   Override hardcoded colors that stay dark in dark-theme.
   ============================================================ */

/* Hub / About section headings & text */
body.dark-theme .hub-eyebrow,
body.dark-theme .hub-sub,
body.dark-theme .hub-card__desc,
body.dark-theme .hub-card__tag {
  color: var(--ink-secondary);
}

body.dark-theme .hub-heading,
body.dark-theme .hub-card__title {
  color: var(--ink);
}

/* Inline-style text in latest-blogs / academic-hub uses CSS vars — covered.
   But fallback for any element that somehow retains a dark literal color: */
body.dark-theme p,
body.dark-theme li,
body.dark-theme span,
body.dark-theme label {
  color: inherit;   /* let var(--ink) cascade from body */
}

/* Fix index.html .dark-mode selectors — they were written with the old class.
   Mirror them under the correct body.dark-theme selector. */
body.dark-theme .hub-card {
  background: var(--paper-dark);
  border-color: var(--border);
  box-shadow: 4px 4px 0 rgba(255,255,255,.07);
}

body.dark-theme .hub-card:hover {
  box-shadow: 6px 7px 0 rgba(255,255,255,.10);
}

body.dark-theme .hub-card--featured {
  border-color: var(--accent-yellow);
  box-shadow: 4px 4px 0 rgba(255,255,255,.25);
}

body.dark-theme .contact-form-card {
  background: var(--paper-dark);
  box-shadow: 5px 5px 0 rgba(255,255,255,.07);
}

body.dark-theme .beta-banner {
  background: var(--paper-dark);
  border-bottom: 1px solid var(--border);
}

body.dark-theme .beta-banner,
body.dark-theme .beta-banner * { color: var(--ink); }

body.dark-theme .beta-pill {
  background: var(--accent-yellow);
  color: #1a1a1a;
}

/* academic-hub section background */
body.dark-theme #academic-hub {
  background: var(--paper-dark);
}


/* ============================================================
   TASK 4 — MOBILE HORIZONTAL CAROUSEL FOR PROJECTS
   Desktop: keep existing grid. Mobile (≤ 600px): swipeable row.
   ============================================================ */

@media (max-width: 600px) {
  /* Turn the cards wrapper into a horizontal scroll container */
  .cards-wrapper {
    display: flex !important;
    flex-direction: row !important;
    grid-template-columns: unset !important;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: var(--sp-4, 16px);
    padding-bottom: 12px;   /* room for momentum scrollbar shadow */
    /* Hide scrollbar visually but keep it functional */
    scrollbar-width: none;
  }
  .cards-wrapper::-webkit-scrollbar { display: none; }

  /* Each card snaps and has a fixed width so you always see the next one */
  .cards-wrapper .project-card {
    flex: 0 0 82vw;
    max-width: 320px;
    scroll-snap-align: start;
    /* Prevent rotation glitches in carousel mode */
    --card-rotate: 0deg;
    transform: none !important;
  }
}
}