/* ============================================================
   Pádraig Lysandrou — Personal Site
   Dark · Technical · Modular
   ============================================================ */

/* Custom Properties
------------------------------------------------------------ */
:root {
  --bg:          #070a0f;
  --bg-2:        #0c1118;
  --bg-3:        #111d2a;
  --surface:     #0d1420;
  --accent:      #7c3aed;
  --accent-2:    #00d4ff;
  --accent-dim:  rgba(124, 58, 237, 0.08);
  --accent-glow: rgba(124, 58, 237, 0.18);
  --text:        #a898c8;
  --text-dim:    #4a3d66;
  --text-bright: #e8d8ff;
  --border:      rgba(124, 58, 237, 0.12);
  --border-2:    rgba(124, 58, 237, 0.32);
  --glow:        0 0 28px rgba(124, 58, 237, 0.18), 0 4px 24px rgba(0, 0, 0, 0.5);
  --font-mono:   'Space Mono', 'Courier New', monospace;
  --font-sans:   'Inter', system-ui, -apple-system, sans-serif;
  --nav-h:       60px;
  --max-w:       1140px;
  --radius:      2px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-color: var(--border-2) var(--bg);
  scrollbar-width: thin;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration: none; transition: color 0.2s, opacity 0.2s; }
a:hover { color: var(--text-bright); }

h1, h2, h3, h4 { color: var(--text-bright); line-height: 1.2; }

ul { list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

/* Selection */
::selection { background: rgba(0, 212, 255, 0.2); color: var(--text-bright); }

/* Nav
------------------------------------------------------------ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}

#nav.scrolled {
  background: rgba(7, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.75; color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links li a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.5rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: color 0.2s, border-color 0.2s;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: var(--accent);
  border-color: var(--border);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--text);
  transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Hero
------------------------------------------------------------ */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
  animation: grid-drift 28s linear infinite;
  pointer-events: none;
}

@keyframes grid-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 64px 64px; }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 1.5rem;
  padding-top: var(--nav-h);
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.hero-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 7.5rem);
  color: var(--text-bright);
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: 1.75rem;
  text-shadow: 0 0 80px rgba(0, 212, 255, 0.12);
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  color: var(--text);
  min-height: 1.6em;
  margin-bottom: 2rem;
}

.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-rule {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 0 auto 2rem;
}

.hero-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.hero-socials li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.hero-socials li a:hover {
  color: var(--accent);
  border-color: var(--border-2);
  box-shadow: var(--glow);
}

.scroll-down {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  display: flex;
  animation: float-down 2.5s ease-in-out infinite;
  transition: color 0.2s;
}

.scroll-down:hover { color: var(--accent); }

@keyframes float-down {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* Sections — shared
------------------------------------------------------------ */
section {
  padding: 7rem 0;
}

.section-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.section-header {
  margin-bottom: 3.5rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  display: block;
  margin-bottom: 0.6rem;
  opacity: 0.85;
}

.section-title {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

.section-header-row {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.section-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

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

/* Scroll-reveal animation */
[data-animate] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: none;
}

/* About
------------------------------------------------------------ */
#about { background: var(--bg-2); }

.about-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 3.5rem;
  align-items: start;
}

.about-photo {
  position: relative;
}

.about-photo img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border-2);
  filter: grayscale(30%) contrast(1.05);
  transition: filter 0.3s;
}

.about-photo::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  pointer-events: none;
}

.about-photo:hover img { filter: grayscale(0%) contrast(1); }

.about-text p {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 1.2rem;
  max-width: 60ch;
}

.about-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-outline {
  color: var(--text);
  border-color: var(--border-2);
  background: transparent;
}

.btn-outline:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: var(--glow);
}

.btn-primary {
  color: var(--bg);
  border-color: var(--accent);
  background: var(--accent);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: var(--glow);
}

/* Projects
------------------------------------------------------------ */
#projects { background: var(--bg); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.project-card {
  background: var(--bg);
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  z-index: 2;
}

.project-card:hover { background: var(--surface); }

.project-card:hover::after {
  border-color: var(--accent);
  box-shadow: inset 0 0 24px rgba(0, 212, 255, 0.06);
}

.project-img {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  background: var(--bg-3);
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.3s;
  filter: brightness(0.75) saturate(0.8);
}

.project-card:hover .project-img img {
  transform: scale(1.06);
  filter: brightness(0.9) saturate(0.9);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7,10,15,0.96) 0%, rgba(7,10,15,0.3) 50%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 0.85rem;
  opacity: 0;
  transition: opacity 0.25s;
}

.project-card:hover .project-overlay { opacity: 1; }

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  padding: 0.2rem 0.45rem;
  letter-spacing: 0.08em;
  border-radius: var(--radius);
  white-space: nowrap;
}

.project-meta {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.project-title {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  transition: color 0.2s;
}

.project-card:hover .project-title { color: var(--text-bright); }

.project-year {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Modal
------------------------------------------------------------ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.modal.open {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.modal-panel {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border-2);
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: var(--radius);
  box-shadow: 0 0 80px rgba(0, 212, 255, 0.08), 0 24px 80px rgba(0, 0, 0, 0.7);
  transform: scale(0.96) translateY(12px);
  transition: transform 0.25s ease;
  scrollbar-color: var(--border-2) var(--surface);
  scrollbar-width: thin;
}

.modal.open .modal-panel { transform: none; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}

.modal-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.modal-title {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--text-bright);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.modal-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.modal-close:hover { color: var(--text-bright); border-color: var(--border-2); }

.modal-body {
  padding: 1.75rem;
}

.modal-body img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  filter: brightness(0.9) saturate(0.85);
}

.modal-body h3 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-bright);
  margin-bottom: 0.9rem;
}

.modal-body p {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.75;
}

.modal-body a {
  color: var(--accent);
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  transition: border-color 0.2s;
}

.modal-body a:hover {
  color: var(--text-bright);
  border-bottom-color: var(--text-bright);
}

.modal-body em { color: var(--text-dim); font-style: italic; }

.modal-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.modal-video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* Resume
------------------------------------------------------------ */
#resume { background: var(--bg-2); }

.resume-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.resume-group {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.timeline {
  position: relative;
  padding-left: 1.4rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--border-2) 0%, var(--border) 60%, transparent 100%);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.25rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.4rem;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.timeline-content h4 {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 0.3rem;
}

.timeline-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
  letter-spacing: 0.04em;
}

.timeline-meta span {
  color: var(--border-2);
  margin: 0 0.25rem;
}

.timeline-content p {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.65;
}

/* Footer
------------------------------------------------------------ */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.footer-socials {
  display: flex;
  gap: 0.5rem;
}

.footer-socials li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color 0.2s, border-color 0.2s;
}

.footer-socials li a:hover {
  color: var(--accent);
  border-color: var(--border-2);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

/* Featured primary projects
------------------------------------------------------------ */
.project-primary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.project-card--featured {
  border: none;
  box-shadow: none;
}

.project-card--featured::after {
  border-color: transparent;
}

.project-card--featured:hover::after {
  border-color: var(--accent);
  box-shadow: inset 0 0 32px rgba(0, 212, 255, 0.07);
}

.project-card--featured .project-img {
  aspect-ratio: 16 / 9;
}

@media (max-width: 600px) {
  .project-primary {
    grid-template-columns: 1fr;
  }
}

/* Old projects accordion
------------------------------------------------------------ */
.old-projects {
  margin-top: 2rem;
}

.old-projects-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-family: inherit;
  text-align: left;
}

.old-projects-btn:hover {
  background: var(--bg-3);
  border-color: var(--border-2);
  color: var(--accent);
}

.old-projects-btn[aria-expanded="true"] {
  border-color: var(--border-2);
  color: var(--accent);
  border-bottom-color: transparent;
}

.old-projects-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: inherit;
}

.old-projects-count {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.old-projects-chevron {
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: inherit;
}

.old-projects-btn[aria-expanded="true"] .old-projects-chevron {
  transform: rotate(180deg);
}

/* Smooth height via CSS grid trick */
.old-projects-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
}

.old-projects-wrap.open {
  grid-template-rows: 1fr;
}

.old-projects-inner {
  overflow: hidden;
  border: 1px solid var(--border-2);
  border-top: none;
}

.old-projects-inner .projects-grid {
  border: none;
  border-top: 1px solid var(--border);
}

/* Responsive
------------------------------------------------------------ */
@media (max-width: 1100px) {
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo img {
    width: 140px;
    height: 140px;
  }

  .about-photo::before { display: none; }

  .resume-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  section { padding: 5rem 0; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(7, 10, 15, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0.25rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s;
  }

  .nav-links.open {
    transform: none;
    opacity: 1;
    pointer-events: all;
  }

  .nav-links li a {
    display: block;
    padding: 0.75rem 1rem;
    text-align: left;
  }

  .nav-toggle { display: flex; }

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

  .hero-name { line-height: 1; }
}

@media (max-width: 480px) {
  .section-wrap { padding: 0 1.25rem; }
  .projects-grid { grid-template-columns: 1fr; }

  .about-actions { flex-direction: column; }
  .btn { justify-content: center; }

  .modal-body { padding: 1.25rem; }
  .modal-header { padding: 1.25rem 1.25rem 1rem; }
}

/* Email eigenvalue challenge
------------------------------------------------------------ */
.email-challenge {
  display: inline-flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font-mono);
}

.challenge-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-dim);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challenge-body {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.challenge-matrix-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.challenge-right {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.matrix-name {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.matrix-display {
  display: inline-grid;
  gap: 3px 10px;
  padding: 5px 10px;
  font-size: 0.8rem;
  color: var(--text-bright);
  position: relative;
}

.matrix-3x3 { grid-template-columns: repeat(3, 1.2ch); }

.matrix-display::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border: 1.5px solid var(--text-dim);
  border-right: none;
}

.matrix-display::after {
  content: '';
  position: absolute;
  inset: 0 0 0 auto;
  width: 5px;
  border: 1.5px solid var(--text-dim);
  border-left: none;
}

.challenge-answer-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0;
}

.challenge-lambda {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.challenge-input {
  width: 3rem;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text-bright);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.28rem 0.4rem;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.challenge-input::-webkit-outer-spin-button,
.challenge-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.challenge-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.challenge-btn {
  padding: 0.28rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1;
}

.challenge-hint {
  font-size: 0.63rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  min-height: 0.85rem;
}
