/* ============================================
   DESIGN SYSTEM — KIPFER.JR PERSONAL WEBSITE
   Tech-brutalist dark palette
   ============================================ */

:root {
  --background:        hsl(220, 13%, 8%);
  --foreground:        hsl(210, 20%, 96%);
  --card:              hsl(220, 13%, 11%);
  --card-foreground:   hsl(210, 20%, 96%);
  --primary:           hsl(187, 100%, 50%);
  --primary-foreground:hsl(220, 13%, 8%);
  --secondary:         hsl(220, 13%, 14%);
  --secondary-foreground: hsl(210, 20%, 96%);
  --muted:             hsl(220, 13%, 14%);
  --muted-foreground:  hsl(220, 9%, 60%);
  --border:            hsl(220, 13%, 20%);
  --input:             hsl(220, 13%, 18%);
  --ring:              hsl(187, 100%, 50%);
  --radius:            0.125rem;

  /* Brand tokens */
  --grid-line:         hsl(220, 13%, 14%);
  --terminal:          hsl(187, 100%, 50%);
  --terminal-dim:      hsl(187, 60%, 40%);
  --warning:           hsl(45, 100%, 60%);
  --surface-elevated:  hsl(220, 13%, 13%);

  --shadow-brutal:     6px 6px 0 0 hsl(187, 100%, 50%);
  --shadow-brutal-sm:  3px 3px 0 0 hsl(187, 100%, 50%);
  --shadow-brutal-fg:  6px 6px 0 0 hsl(210, 20%, 96%);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--primary);
  color: var(--primary-foreground);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

ul { list-style: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; }
img { display: block; max-width: 100%; }

/* ===== COLOR HELPERS ===== */
.text-primary   { color: var(--primary); }
.text-muted     { color: var(--muted-foreground); }
.text-foreground{ color: var(--foreground); }
.bg-secondary-tint { background-color: hsla(220, 13%, 14%, 0.2); }

/* ===== TYPOGRAPHY HELPERS ===== */
.font-mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.font-sans  { font-family: 'Space Grotesk', system-ui, sans-serif; }

.text-glow {
  text-shadow: 0 0 20px hsla(187, 100%, 50%, 0.5);
}

.label-mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
}

.inline-code {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--primary);
}

/* ===== BORDER HELPERS ===== */
.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
}

.col-5 {
  grid-column: span 12;
}

.col-7 {
  grid-column: span 12;
}

@media (min-width: 1024px) {
  .col-5 { grid-column: span 5; }
  .col-7 { grid-column: span 7; padding-left: 2rem; }
}

/* ===== ICONS ===== */
.icon-sm {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.icon-xs {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

/* ===== TAG ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

/* ===== BLINK CURSOR ===== */
.blink::after {
  content: "▊";
  animation: blink 1s step-end infinite;
  color: var(--primary);
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ===== SECTION LABELS & TITLES ===== */
.section__label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.section__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 700;
  line-height: 0.9;
  margin-bottom: 2rem;
}

.section__title--xl {
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 0.9;
}

/* ===== NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: hsla(220, 13%, 8%, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  gap: 1rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav__logo-icon {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--primary);
  color: var(--primary-foreground);
}

.nav__logo-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875rem;
  letter-spacing: -0.02em;
}

.nav__links {
  display: none;
  align-items: center;
  gap: 0.25rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
}

@media (min-width: 768px) {
  .nav__links { display: flex; }
}

.nav__link {
  padding: 0.375rem 0.75rem;
  color: var(--muted-foreground);
  transition: color 0.2s, background 0.2s;
}

.nav__link:hover {
  color: var(--foreground);
  background: var(--secondary);
}

.nav__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.nav__status-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--primary);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.nav__status-text {
  display: none;
}

@media (min-width: 640px) {
  .nav__status-text { display: inline; }
}

/* Mobile toggle button */
.nav__mobile-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav__mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--foreground);
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .nav__mobile-toggle { display: none; }
}

/* Mobile menu */
.nav__mobile {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
  background: var(--background);
}

.nav__mobile.open {
  display: flex;
}

.nav__mobile-link {
  padding: 1rem 1.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, background 0.2s;
}

.nav__mobile-link:hover {
  color: var(--foreground);
  background: var(--secondary);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  overflow: hidden;
}

.hero__grid-bg {
  position: absolute;
  inset: 0;
  opacity: 0.6;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
}

.hero__scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 2px,
    hsla(210, 20%, 96%, 0.025) 2px,
    hsla(210, 20%, 96%, 0.025) 3px
  );
}

.hero__inner {
  position: relative;
  padding-top: 5rem;
  padding-bottom: 6rem;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
  margin-bottom: 3rem;
}

.hero__meta-left,
.hero__meta-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero__ts { display: none; }

@media (min-width: 768px) {
  .hero__ts { display: inline; }
}

.hero__name-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: flex-end;
}

@media (min-width: 1024px) {
  .hero__name-grid {
    grid-template-columns: 9fr 3fr;
  }
}

.hero__name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.02em;
  font-size: clamp(4rem, 18vw, 9rem);
}

@media (min-width: 768px) {
  .hero__name { font-size: clamp(5rem, 11vw, 9rem); }
}

.hero__role-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1.5rem;
}

.hero__role-item {
  padding-left: 1rem;
}

.hero__role-item--primary {
  border-left: 2px solid var(--primary);
}

.hero__role-item--secondary {
  border-left: 2px solid var(--border);
}

.hero__role-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.125rem;
  line-height: 1.3;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--border);
  margin-top: 4rem;
}

@media (min-width: 768px) {
  .hero__stats { grid-template-columns: repeat(4, 1fr); }
}

.hero__stat {
  padding: 1.25rem;
  border-right: 1px solid var(--border);
}

.hero__stat:last-child { border-right: none; }

.hero__stat--alt {
  background: hsla(220, 13%, 14%, 0.4);
}

.hero__stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary);
}

.hero__stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.hero__scroll {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ===== TICKER ===== */
.ticker {
  background: var(--secondary);
  overflow: hidden;
}

.ticker__track {
  display: flex;
  white-space: nowrap;
  padding: 0.5rem 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
  animation: ticker 40s linear infinite;
}

.ticker__item {
  padding: 0 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
}

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== ABOUT ===== */
.about__bio {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 1rem;
  color: var(--muted-foreground);
  max-width: 28rem;
}

.about__bio strong {
  color: var(--foreground);
  font-weight: 500;
}

.skills-panel {
  border: 1px solid var(--border);
  background: hsla(220, 13%, 14%, 0.3);
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .skills-panel { padding: 2rem; }
}

.skills-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.skill {
  margin-bottom: 1.75rem;
}

.skill:last-child { margin-bottom: 0; }

.skill__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
}

.skill__code { color: var(--muted-foreground); margin-right: 0.5rem; }
.skill__pct  { color: var(--primary); }

.skill__bar {
  height: 0.5rem;
  background: var(--background);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.skill__fill {
  position: absolute;
  inset-block: 0;
  left: 0;
  background: var(--primary);
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BTN BRUTAL ===== */
.btn-brutal {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  box-shadow: var(--shadow-brutal-fg);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-top: 2rem;
}

.btn-brutal:hover {
  transform: translate(2px, 2px);
  box-shadow: none;
  color: var(--primary-foreground);
}

/* ===== WORKS ===== */
.works__header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 768px) {
  .works__header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.works__sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  max-width: 18rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.works__list { border-top: 1px solid var(--border); }

.work-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 2rem 0.5rem;
  margin: 0 -0.5rem;
  transition: background 0.2s;
  cursor: pointer;
}

@media (min-width: 768px) {
  .work-item {
    grid-template-columns: auto 5fr 4fr 1fr auto;
    align-items: baseline;
  }
}

.work-item:hover { background: var(--background); }
.work-item:hover .work-item__title { color: var(--primary); }
.work-item:hover .work-item__arrow { color: var(--primary); transform: translate(4px, -4px); }

.work-item__id {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--primary);
  padding-top: 0.25rem;
}

.work-item__title-wrap { grid-column: 1 / -1; }

@media (min-width: 768px) {
  .work-item__title-wrap { grid-column: auto; }
}

.work-item__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.25rem, 3vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: color 0.2s;
}

.work-item__client {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.work-item__desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .work-item__desc { grid-column: auto; }
}

.work-item__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .work-item__stack { grid-column: auto; }
}

.work-item__arrow {
  justify-self: flex-end;
  align-self: flex-start;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--muted-foreground);
  transition: color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

/* ===== HOBBIES ===== */
.hobbies__header {
  margin-bottom: 3.5rem;
}

.hobbies__grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .hobbies__grid { grid-template-columns: repeat(3, 1fr); }
}

.hobby-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 17.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.hobby-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-brutal-sm);
}

.hobby-card:hover .hobby-card__title { color: var(--primary); }

.hobby-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.hobby-card__index {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
}

.hobby-card__icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
}

.hobby-card__glyph {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 4.5rem;
  font-weight: 700;
  color: hsla(187, 100%, 50%, 0.1);
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  line-height: 1;
  user-select: none;
}

.hobby-card__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  transition: color 0.2s;
}

.hobby-card__sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

.hobby-card__desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin-top: auto;
  padding-right: 3rem;
}

.hobby-card__cta {
  margin-top: 1.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== CONTACT ===== */
.contact__sub {
  color: var(--muted-foreground);
  max-width: 28rem;
  margin-bottom: 2.5rem;
}

.contact__email-link {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.contact__email-link:hover .contact__email-text {
  border-bottom-color: var(--primary);
}

.contact__email-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  background: var(--primary);
  color: var(--primary-foreground);
  flex-shrink: 0;
}

.contact__email-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.25rem, 3vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

.contact__endpoints {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.contact__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875rem;
}

.contact__list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contact__list a:hover { color: var(--primary); }

.contact__ping {
  border: 1px solid var(--border);
  padding: 1.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--background);
  border-top: 1px solid var(--border);
}

.footer__inner {
  padding: 2.5rem 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-foreground);
}

@media (min-width: 768px) {
  .footer__inner {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer__center { text-align: center; }
  .footer__right  { text-align: right; }
}