/* =====================
   CSS VARIABLES & RESET
   ===================== */
:root {
  --bg: #0D0D0D;
  --text: #F5F5F5;
  --accent: #F59E0B;
  --muted: #8C8C8C;
  --border: #222222;
  --green: #22C55E;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
  --font-body: 'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  cursor: auto;
  overflow-x: hidden;
}

/* =====================
   GRAIN OVERLAY
   ===================== */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23grain)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* =====================
   CUSTOM CURSOR
   ===================== */
#cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
  top: -20px;
  left: -20px;
}

/* =====================
   FIXED AVAILABILITY BADGE (top-left)
   ===================== */
#avail-badge {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  z-index: 1000;
  letter-spacing: 0.06em;
  line-height: 1;
}

/* =====================
   FIXED CTA (bottom-right)
   ===================== */
#fixed-cta {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--accent);
  color: #0D0D0D;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  z-index: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  transition: opacity 0.2s ease;
}
#fixed-cta:hover { opacity: 0.82; }

/* =====================
   KEYBOARD TOAST
   ===================== */
#kbd-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  background: rgba(13, 13, 13, 0.88);
  border: 1px solid var(--border);
  padding: 0.45rem 1rem;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
#kbd-toast.visible { opacity: 1; }

/* =====================
   ANIMATIONS
   ===================== */
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  50%       { opacity: 0.75; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

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

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

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

/* =====================
   LAYOUT
   ===================== */
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

section {
  padding: 6rem 0;
  position: relative;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-heading {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.section-sub {
  font-family: var(--font-body);
  font-size: 0.975rem;
  color: var(--muted);
  max-width: 640px;
  line-height: 1.75;
  margin-bottom: 3.5rem;
}

/* =====================
   SCROLL REVEAL
   ===================== */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: none;
}

/* =====================
   DIAGONAL SECTION DIVIDERS
   (alternate bg sections)
   ===================== */
#case-studies,
#stack,
#contact {
  background: #111111;
  clip-path: polygon(0 40px, 100% 0, 100% 100%, 0 100%);
  margin-top: -40px;
  padding-top: 110px;
  position: relative;
  z-index: 1;
}

/* =====================
   HERO
   ===================== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.avail-hero {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green);
  margin-bottom: 1.75rem;
  letter-spacing: 0.05em;
}

.hero-name {
  font-family: var(--font-head);
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.typewriter-wrap {
  font-family: var(--font-mono);
  font-size: clamp(0.78rem, 1.8vw, 1rem);
  color: var(--muted);
  margin-bottom: 3rem;
  min-height: 1.5em;
  letter-spacing: 0.02em;
}

.hero-cta {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--accent);
  color: #0D0D0D;
  padding: 1rem 2.25rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  transition: opacity 0.2s ease;
}
.hero-cta:hover { opacity: 0.82; }

/* =====================
   CASE STUDIES
   ===================== */
.case-study {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border);
}
.case-study:first-of-type { border-top: 1px solid var(--border); }

.cs-stat {
  font-family: var(--font-head);
  font-size: clamp(3.5rem, 7vw, 7rem);
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  min-width: clamp(110px, 14vw, 190px);
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.cs-stat.visible {
  opacity: 1;
  transform: none;
}

.cs-content {
  flex: 1;
  padding-top: 0.5rem;
}

.cs-name {
  font-family: var(--font-head);
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.cs-desc {
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1rem;
  max-width: 580px;
}

.cs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  letter-spacing: 0.05em;
}

/* =====================
   SERVICES
   ===================== */
.services-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.service-item {
  display: flex;
  gap: 1.1rem;
  padding: 2rem 1.75rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.svc-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 700;
  min-width: 26px;
  padding-top: 4px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.svc-body { flex: 1; }

.svc-name {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  position: relative;
  cursor: default;
}
.svc-name::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.35s ease;
}
.service-item:hover .svc-name::after { width: 100%; }

.svc-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.svc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.svc-tags span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.12rem 0.42rem;
  letter-spacing: 0.04em;
}

/* =====================
   HOW I WORK (Process)
   ===================== */
#how-i-work {
  border-top: 1px solid var(--border);
}

.process-steps {
  list-style: none;
  position: relative;
  max-width: 700px;
}

.process-steps::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--border);
  z-index: 0;
}

.process-step {
  display: flex;
  gap: 1.75rem;
  padding-bottom: 2.5rem;
  align-items: flex-start;
  position: relative;
}

.process-step:last-child { padding-bottom: 0; }

.step-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #0D0D0D;
  background: var(--accent);
  font-weight: 700;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step-body {
  flex: 1;
  padding-top: 0.4rem;
}

.step-name {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.step-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.75;
}

/* =====================
   STACK
   ===================== */
.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem 4rem;
}

.stack-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.stack-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* =====================
   TIMELINE (git log)
   ===================== */
.git-log {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
  margin-left: 0.75rem;
}

.git-entry {
  margin-bottom: 0.25rem;
}

.git-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.git-graph {
  color: var(--muted);
  margin-left: -1.75rem;
  background: var(--bg);
  padding-right: 0.3rem;
}

.git-hash { color: var(--accent); }
.git-branch { color: var(--muted); font-style: italic; }
.git-msg { color: var(--text); font-weight: 700; }

.git-tag {
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 0.08rem 0.4rem;
  font-size: 0.72rem;
  border-radius: 2px;
  font-style: normal;
}

.git-connector {
  color: var(--muted);
  padding-left: 0;
  display: block;
  line-height: 1.4;
  margin-left: -1.75rem;
  background: var(--bg);
  width: fit-content;
  padding-right: 0.3rem;
}

.git-detail {
  color: var(--muted);
  padding-left: 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.77rem;
  line-height: 1.7;
}

/* =====================
   CONTACT
   ===================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
  align-items: start;
}

.contact-avail {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green);
  margin-bottom: 2.5rem;
  letter-spacing: 0.03em;
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.contact-link {
  font-size: 0.93rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}
.contact-link:hover { color: var(--accent); }

/* Form */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-field:last-of-type { margin-bottom: 0; }

label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

label abbr {
  color: var(--accent);
  text-decoration: none;
  margin-left: 2px;
}

input,
select,
textarea {
  background: #0a0a0a;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

textarea { resize: vertical; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

select option { background: #0a0a0a; }

input::placeholder,
textarea::placeholder { color: #333; }

.submit-btn {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--accent);
  color: #0D0D0D;
  border: none;
  padding: 1rem 2rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  transition: opacity 0.2s ease;
  width: 100%;
}
.submit-btn:hover { opacity: 0.82; }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#formSuccess {
  padding: 2rem;
  border: 1px solid var(--green);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--green);
  letter-spacing: 0.05em;
}

/* =====================
   FOOTER
   ===================== */
#footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-logo {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.footer-nav {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.2s ease;
}
.footer-nav a:hover { color: var(--accent); }

/* =====================
   TERMINAL TRIGGER BUTTON
   ===================== */
#term-trigger {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: rgba(13,13,13,0.9);
  border: 1px solid rgba(245,158,11,0.35);
  color: var(--accent);
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  letter-spacing: 0.07em;
  z-index: 999;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  line-height: 1;
}
#term-trigger:hover {
  border-color: var(--accent);
  background: rgba(245,158,11,0.07);
}
#term-trigger.hidden { display: none; }

/* =====================
   HERO CODE DECORATION
   ===================== */
.hero-code-deco {
  position: absolute;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 2;
  color: rgba(245,158,11,0.13);
  pointer-events: none;
  user-select: none;
  white-space: pre;
  border-left: 2px solid rgba(245,158,11,0.07);
  padding-left: 1.25rem;
  letter-spacing: 0.02em;
}
@media (max-width: 960px) { .hero-code-deco { display: none; } }

/* =====================
   HERO META STATS
   ===================== */
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero-meta-item strong {
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.3rem;
}

/* =====================
   KEYBOARD MAP (footer)
   ===================== */
.kbd-map {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.kbd-key {
  display: inline-block;
  border: 1px solid var(--border);
  padding: 0.1rem 0.38rem;
  font-size: 0.58rem;
  color: var(--accent);
  letter-spacing: 0.03em;
  vertical-align: middle;
  line-height: 1.6;
}

/* =====================
   TERMINAL EASTER EGG
   ===================== */
#terminal {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 400px;
  height: 220px;
  background: #0a0a0a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: none;
  flex-direction: column;
  z-index: 2000;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

#terminal.open { display: flex; }

#term-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  background: #111;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  flex-shrink: 0;
}

#term-title {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
}

#term-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
  transition: color 0.2s;
}
#term-close:hover { color: var(--accent); }

#term-output {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  line-height: 1.55;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#term-output::-webkit-scrollbar { width: 4px; }
#term-output::-webkit-scrollbar-track { background: transparent; }
#term-output::-webkit-scrollbar-thumb { background: var(--border); }

.term-line { color: var(--text); white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word; }
.term-line.muted { color: var(--muted); }
.term-line.accent { color: var(--accent); }
.term-prompt-echo { color: var(--muted); margin-top: 0.2rem; }
.term-prompt-color { color: var(--accent); }

#term-prompt-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-top: 1px solid rgba(245, 158, 11, 0.15);
  flex-shrink: 0;
}

.term-prompt-str {
  color: var(--accent);
  white-space: nowrap;
  font-size: 0.72rem;
}

#term-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  outline: none;
  flex: 1;
  caret-color: var(--accent);
  padding: 0;
  width: 100%;
  appearance: none;
}

/* =====================
   PIXEL TAMAGOTCHI
   ===================== */
#tama {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

#tama-bubble {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent);
  background: rgba(13, 13, 13, 0.94);
  border: 1px solid rgba(245, 158, 11, 0.38);
  padding: 0.22rem 0.55rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  line-height: 1.5;
}

#tama-bubble.visible { opacity: 1; }

#tama-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  animation: tama-float 3s ease-in-out infinite;
}

@keyframes tama-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

#tama-bar {
  width: 48px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

#tama-bar-fill {
  height: 100%;
  width: 100%;
  background: var(--green);
  transition: width 0.5s ease, background 0.5s ease;
}

/* ── Per-theme bubble colours ─────────────────────────────────────────── */
#tama[data-theme="ai"] #tama-bubble {
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.38);
}

#tama[data-theme="mobile"] #tama-bubble {
  color: #3DDC84;
  border-color: rgba(61, 220, 132, 0.38);
}

#tama[data-theme="specialist"] #tama-bubble {
  color: #A78BFA;
  border-color: rgba(124, 58, 237, 0.38);
}

/* ── Challenge-active pulse ───────────────────────────────────────────── */
#tama.challenge-active #tama-canvas {
  animation: tama-float 1s ease-in-out infinite, tama-challenge-pulse 0.35s ease-in-out infinite;
}

@keyframes tama-challenge-pulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-3px) scale(1.08); }
}

#tama.challenge-active #tama-bubble {
  animation: tama-challenge-blink 0.5s step-start infinite;
}

@keyframes tama-challenge-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* =====================
   QUICK BRIEF WIDGET
   ===================== */
#qb-trigger {
  position: fixed;
  bottom: 4rem;
  left: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: rgba(13, 13, 13, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--accent);
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  letter-spacing: 0.07em;
  z-index: 999;
  transition: border-color 0.2s ease, background 0.2s ease;
  line-height: 1;
}

#qb-trigger:hover {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.07);
}

#qb-panel {
  position: fixed;
  bottom: 7rem;
  left: 1.5rem;
  width: 360px;
  background: #0a0a0a;
  border: 1px solid rgba(245, 158, 11, 0.4);
  z-index: 2000;
  font-family: var(--font-mono);
  display: none;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.75rem;
}

#qb-panel.open { display: flex; }

#qb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

#qb-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.2rem;
  transition: color 0.2s ease;
}

#qb-close:hover { color: var(--accent); }

#qb-hint {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.65;
  font-family: var(--font-body);
  letter-spacing: 0;
}

#qb-result {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.65;
  display: none;
}

#qb-result.visible { display: block; }

.qb-detected {
  color: var(--accent);
  font-weight: 700;
}

.qb-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.qb-link {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.4rem 0.85rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: opacity 0.2s ease;
  cursor: pointer;
  border: none;
}

.qb-link:hover { opacity: 0.82; }

.qb-link-email {
  background: var(--accent);
  color: #0D0D0D;
}

.qb-link-linkedin {
  background: transparent;
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: var(--accent);
}

#qb-analyze {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--accent);
  color: #0D0D0D;
  border: none;
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.2s ease;
}

#qb-analyze:hover { opacity: 0.82; }
#qb-analyze:disabled { opacity: 0.5; cursor: not-allowed; }

/* =====================
   MOBILE (≤640px)
   ===================== */
@media (max-width: 640px) {
  body { cursor: auto; }

  #cursor { display: none !important; }
  #terminal { display: none !important; }
  #term-trigger { display: none !important; }
  #kbd-toast { display: none !important; }
  .kbd-map { display: none !important; }
  #tama { display: none !important; }
  #qb-trigger { display: none !important; }
  #qb-panel { display: none !important; }

  .section-inner { padding: 0 1.25rem; }
  section { padding: 4rem 0; }

  #case-studies,
  #stack,
  #contact {
    clip-path: none;
    margin-top: 0;
    padding-top: 4rem;
  }

  .hero-name { letter-spacing: -0.01em; }

  .hero-cta {
    display: block;
    width: 100%;
    text-align: center;
  }

  .case-study {
    flex-direction: column;
    gap: 1rem;
  }

  .cs-stat { min-width: unset; }

  .services-list {
    grid-template-columns: 1fr;
    border-left: none;
    border-top: none;
  }

  .service-item {
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
  }

  .stack-grid { grid-template-columns: 1fr; gap: 2rem; }

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

  .form-row { grid-template-columns: 1fr; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-nav { justify-content: center; }

  .git-log { font-size: 0.72rem; }
  .git-line { gap: 0.35rem; }

  #avail-badge { font-size: 0.6rem; }
  #fixed-cta { font-size: 0.62rem; padding: 0.6rem 0.9rem; }

  .process-step { gap: 1rem; padding-bottom: 2rem; }
  .step-num { width: 28px; height: 28px; font-size: 0.58rem; }
  .step-desc { font-size: 0.82rem; }
}
