:root {
  --bg: #0f1012;
  --surface: #16181a;
  --surface-raised: #1e2023;
  --text: #f0f0f0;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;
  --border: #2a2d31;
  --accent: #4ade80;
  --accent-hover: #22c55e;
  --accent-soft: rgba(74, 222, 128, 0.1);
  --accent-warm: #f97316;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.4), 0 20px 50px rgba(0, 0, 0, 0.5);
  --radius: 10px;
  --radius-sm: 6px;
  --max-width: 1200px;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --transition: 150ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: #0f1012;
  padding: 8px 16px;
  z-index: 100;
  font-weight: 500;
}

.skip-link:focus {
  top: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 16, 18, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 500;
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.site-nav a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.mobile-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-muted);
  margin: 0 auto;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), color var(--transition);
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #0f1012;
}

.button-primary:hover {
  background: var(--accent-hover);
  color: #0f1012;
}

.button-secondary {
  background: var(--surface-raised);
  color: var(--text);
  border-color: var(--border);
}

.button-secondary:hover {
  border-color: var(--accent);
  color: var(--text);
}

.button-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.button-ghost:hover {
  color: var(--text);
  border-color: var(--text-subtle);
}

.button-small {
  padding: 7px 14px;
  font-size: 0.85rem;
}

/* Sections */
.section {
  padding: 96px 0;
}

.section-header {
  margin-bottom: 48px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 12px;
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  color: var(--text);
}

.section-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: -24px 0 48px;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  padding: 64px 0;
  overflow: hidden;
}

.hero-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-visual {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.hero-image-mask {
  position: absolute;
  left: -80px;
  top: 0;
  bottom: 0;
  width: calc(100% + 80px);
  z-index: 0;
  -webkit-mask-image: url(/static/img/torn-mask.png);
  mask-image: url(/static/img/torn-mask.png);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  overflow: hidden;
}

.hero-image-mask video,
.hero-image-mask img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.1) brightness(0.85);
}

.hero-side-label {
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: left center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-subtle);
  white-space: nowrap;
  z-index: 2;
  will-change: transform;
}

.hero-decor {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  color: var(--text-subtle);
  z-index: 2;
  will-change: transform;
}

.decor-tilde {
  font-size: 1.4rem;
  color: var(--accent);
  opacity: 0.6;
}

.decor-number {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.whoami-block {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  z-index: 5;
}

.whoami-prompt {
  font-size: 0.8rem;
  color: var(--accent);
}

.whoami-name {
  font-size: 1rem;
  color: var(--text);
  font-weight: 500;
}

.whoami-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stack-card {
  position: absolute;
  top: 15%;
  right: 5%;
  z-index: 5;
  background: rgba(22, 24, 26, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
}

.stack-prompt {
  display: block;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 10px;
}

.stack-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stack-card li {
  position: relative;
  padding-left: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stack-card li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.stack-card li:last-child::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 12px;
  background: var(--accent);
  margin-left: 6px;
  animation: cursor-blink 1s step-end infinite;
}

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

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0 0 16px;
}

.hero-title {
  font-size: 3.6rem;
  font-weight: 600;
  line-height: 1.05;
  margin: 0 0 28px;
  letter-spacing: -0.02em;
}

.hero-title--compact {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 0 16px;
  letter-spacing: 0;
}

.accent-line {
  color: var(--accent);
}

.hero-title .accent-line {
  display: block;
  max-width: 16em;
  line-height: 1.15;
}

.hero-hot-take {
  margin-top: 28px;
}

.hero-hot-take-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--text-subtle);
}

.hot-take-reload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-subtle);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.hot-take-reload:hover,
.hot-take-reload:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

.hot-take-reload.htmx-request {
  color: var(--accent);
  opacity: 0.7;
}

.hero-quote {
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--accent);
  max-width: 28em;
}

.hero-quote-text {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 500;
  font-style: italic;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}

.hero-body {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 0 20px;
}

.hero-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 32px 0 36px;
}

.tech-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--text-subtle);
  transition: color var(--transition), transform var(--transition);
}

.tech-icon:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.tech-icon svg {
  width: 26px;
  height: 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: rgba(74, 222, 128, 0.3);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.project-name {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  font-family: var(--font-mono);
}

.project-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.project-tagline {
  font-size: 1.05rem;
  color: var(--text);
  margin: 0;
  font-weight: 500;
}

.project-problem {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  flex-grow: 1;
}

.project-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* Contact */
.section-contact {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.contact-inner {
  text-align: center;
}

.contact-lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 32px;
}

.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.contact-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-subtle);
  margin: 0;
}

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

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-subtle);
}

.footer-inner p {
  margin: 0;
}

/* Drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}

.drawer.is-open {
  pointer-events: auto;
  opacity: 1;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.drawer-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 250ms ease;
  overflow-y: auto;
  padding: 48px;
}

.drawer.is-open .drawer-panel {
  transform: translateX(0);
}

.drawer-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.drawer-close:hover {
  border-color: var(--accent);
  color: var(--text);
}

.drawer-header {
  margin-bottom: 24px;
}

.drawer-header h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.drawer-section {
  margin-bottom: 28px;
}

.drawer-section h3 {
  font-size: 0.9rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin: 0 0 8px;
}

.drawer-section p {
  color: var(--text-muted);
  margin: 0;
}

.section-career {
  padding-bottom: 120px;
}

.company-accordion {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.company-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.company-panel:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(74, 222, 128, 0.2);
}

.company-header {
  display: grid;
  grid-template-columns: 52px 1fr auto 40px;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 18px 22px;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}

.company-header:hover {
  background: var(--surface-raised);
}

.company-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.company-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.company-logo img,
.company-logo svg {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.company-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.company-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.company-range {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.company-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.company-cue {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--text-subtle);
  text-align: center;
  transition: transform 200ms ease, color var(--transition);
}

.company-panel.is-expanded .company-cue {
  transform: rotate(45deg);
  color: var(--accent);
}

.company-roles {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 350ms ease, opacity 250ms ease;
}

.company-panel.is-expanded .company-roles {
  max-height: 2000px;
  opacity: 1;
}

.company-role {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding: 18px 22px;
  border-top: 1px solid var(--border);
}

.company-role-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.company-role-body h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}

.company-role-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 10px;
  line-height: 1.5;
}

.company-role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.company-role-tags span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-visual {
    order: -1;
    min-height: 420px;
  }

  .hero-image-mask {
    left: -24px;
    width: calc(100% + 48px);
  }

  .hero-side-label {
    display: none;
  }

  .hero-title {
    font-size: 2.8rem;
  }

  .hero-quote-text {
    font-size: 1.35rem;
  }
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .company-header {
    grid-template-columns: 44px 1fr 40px;
    gap: 12px;
    padding: 14px 18px;
  }

  .company-logo {
    width: 40px;
    height: 40px;
  }

  .company-count {
    display: none;
  }

  .company-role {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px 18px;
  }

  .company-role-period {
    font-size: 0.7rem;
  }
}

@media (max-width: 640px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }

  .site-nav a:last-child {
    border-bottom: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .hero {
    padding: 48px 0;
    min-height: auto;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-quote-text {
    font-size: 1.25rem;
  }

  .hero-body {
    font-size: 1rem;
  }

  .section {
    padding: 64px 0;
  }

  .stack-card {
    right: 0;
    padding: 12px 16px;
  }

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

  .drawer-panel {
    padding: 32px 24px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button:hover,
  .project-card:hover,
  .tech-icon:hover {
    transform: none;
  }

  .drawer,
  .drawer-panel {
    transition: none;
  }

  .stack-card li:last-child::after {
    animation: none;
  }
}
