:root {
  --bg: #10141b;
  --panel: #161c25;
  --surface: #1b222c;
  --surface-alt: #242c38;
  --ink: #e6eaf0;
  --ink-muted: #8892a3;
  --cyan: #5fc9d6;
  --amber: #e0a852;
  --green: #7bcf9e;
  --cyan-tint: #1d323a;
  --amber-tint: #33291b;
  --green-tint: #1c2f27;
  --border: #2a3242;
  --radius-lg: 14px;
  --radius-md: 10px;
  --font-display: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --max-width: 74rem;
  --narrow: 44rem;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 26px 26px;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 4rem);
}

/* ---------- nav ---------- */

.header-band {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

header.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 1.75rem 0 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
}

.brand .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(123, 207, 158, 0.6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(123, 207, 158, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(123, 207, 158, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(123, 207, 158, 0);
  }
}

nav.nav-links {
  display: flex;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.85rem;
}

nav.nav-links a {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-md);
  color: var(--ink-muted);
  border: 1px solid transparent;
}

nav.nav-links a::before {
  content: "./";
  color: var(--cyan);
  opacity: 0.7;
}

nav.nav-links a:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}

nav.nav-links a.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--cyan);
}

/* ---------- section rhythm ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--cyan);
  margin: 0 0 0.75rem;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--cyan);
  border-radius: 1px;
  flex-shrink: 0;
}

.header-band .eyebrow {
  color: var(--cyan);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  color: var(--ink);
}

p {
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.05rem;
  color: var(--ink-muted);
  max-width: 34rem;
}

.narrow {
  max-width: var(--narrow);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: 2.25rem 0 3.5rem;
}

.hero--simple {
  grid-template-columns: 1fr;
}

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

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* ---------- section boxes ---------- */

.section-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2.75rem 0 3.5rem;
}

.section-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 2.75rem);
}

/* ---------- photo frame (signature element: instrument viewport) ---------- */

.photo-frame {
  position: relative;
  width: 100%;
  padding: 10px;
}

.photo-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--cyan), var(--cyan)) top left / 16px 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) top left / 2px 16px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) top right / 16px 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) top right / 2px 16px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom left / 16px 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom left / 2px 16px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 16px 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 2px 16px no-repeat;
}

.photo-frame .placeholder,
.photo-frame img {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: var(--panel);
  border: 1px dashed var(--border);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  object-fit: cover;
}

.photo-frame .placeholder {
  flex-direction: column;
  gap: 0.4rem;
  color: var(--ink-muted);
  text-align: center;
  padding: 1rem;
  font-family: var(--font-mono);
}

.photo-frame .placeholder .icon {
  font-size: 1.4rem;
}

.photo-frame .placeholder span.label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.photo-frame.sm .placeholder,
.photo-frame.sm img {
  aspect-ratio: 4 / 5;
}

/* ---------- gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.5rem;
}

.gallery-caption {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-align: center;
}

/* ---------- cards / projects ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.card h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--cyan);
  text-decoration-thickness: 2px;
}

.card p {
  color: var(--ink-muted);
  margin-bottom: 0.85rem;
}

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

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface-alt);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
}

.tags .tag:nth-child(3n + 1) {
  background: var(--cyan-tint);
  color: var(--cyan);
}

.tags .tag:nth-child(3n + 2) {
  background: var(--amber-tint);
  color: var(--amber);
}

.tags .tag:nth-child(3n + 3) {
  background: var(--green-tint);
  color: var(--green);
}

ul.plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ---------- contact (styled as labeled I/O ports) ---------- */

.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-list a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.contact-list a:hover {
  background: var(--surface-alt);
  border-color: var(--cyan);
}

/* ---------- blog list ---------- */

.post-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.4rem;
  margin-bottom: 0.9rem;
}

.post-item .post-item-main a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}

.post-item .post-item-main a:hover {
  text-decoration: underline;
  text-decoration-color: var(--cyan);
}

.post-item .post-item-excerpt {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin-top: 0.3rem;
  max-width: 38rem;
}

.post-item time {
  font-family: var(--font-mono);
  color: var(--ink-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.post-meta {
  font-family: var(--font-mono);
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

/* ---------- post body ---------- */

.post-body h2 {
  font-size: 1.3rem;
  margin-top: 2.25rem;
}

.post-body p {
  color: var(--ink);
}

.post-body pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-alt);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.post-body blockquote {
  margin: 1.25rem 0;
  padding: 0.3rem 1.25rem;
  border-left: 3px solid var(--amber);
  color: var(--ink-muted);
}

.post-body ul,
.post-body ol {
  padding-left: 1.4rem;
}

/* ---------- footer / empty states ---------- */

footer.site-footer {
  padding: 2rem 0 3rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.empty-state {
  color: var(--ink-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* ---------- contact button + dialog ---------- */

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--cyan);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.6rem;
  color: var(--bg);
  cursor: pointer;
  box-shadow: 0 0 0 rgba(95, 201, 214, 0);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.contact-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 22px rgba(95, 201, 214, 0.45);
  transform: translateY(-1px);
}

.contact-btn:active {
  transform: translateY(0);
}

dialog.contact-dialog {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem 2rem;
  max-width: 26rem;
  width: calc(100% - 2rem);
  font-family: var(--font-body);
}

dialog.contact-dialog::backdrop {
  background: rgba(4, 6, 10, 0.7);
}

dialog.contact-dialog h2 {
  margin: 0 0 0.25rem;
}

.contact-dialog-close {
  display: flex;
  justify-content: flex-end;
  margin: -0.5rem -0.5rem 0 0;
}

.contact-dialog-x {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.contact-dialog-x:hover {
  color: var(--ink);
}

.contact-email-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.contact-email {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  color: var(--cyan);
  user-select: all;
}

.contact-copy-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  color: var(--ink);
  cursor: pointer;
}

.contact-copy-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
