/* Portfolio: dark ops-console look. Plain CSS, no build step. */

:root {
  --bg: #0b0d10;
  --surface: #12161b;
  --raised: #171c23;
  --border: #232a33;
  --text: #e6e9ee;
  --muted: #8b95a3;
  --ok: #3ddc97;
  --bad: #ff6b6b;
  --warn: #f5a524;
  --info: #5aa9ff;

  /* Project accents */
  --amber: #f5a524;
  --green: #3ddc97;
  --blue: #5aa9ff;
  --accent: var(--info);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  /* 8px grid */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s6: 48px;
  --s8: 64px;
  --s12: 96px;

  --radius: 10px;
  --max: 1100px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--s8);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

code, pre, kbd { font-family: var(--mono); }
code { font-size: 0.88em; }
p code, li code {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--raised);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--s2);
  top: -100px;
  z-index: 10;
  padding: var(--s1) var(--s2);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.skip:focus { top: var(--s2); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--s3);
  padding-right: var(--s3);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(11, 13, 16, 0.92);
  border-bottom: 1px solid var(--border);
}
@supports (backdrop-filter: blur(8px)) {
  .site-header { background: rgba(11, 13, 16, 0.8); backdrop-filter: blur(8px); }
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--s8);
}
.site-header__home {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
}
.contact {
  display: flex;
  gap: var(--s3);
  font-size: 15px;
}
.contact a { color: var(--muted); text-decoration: none; }
.contact a:hover { color: var(--text); }

/* ---------- Hero ---------- */

.hero {
  padding-top: var(--s12);
  padding-bottom: var(--s12);
}
.hero__name {
  font-size: clamp(44px, 9vw, 88px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.hero__line {
  margin-top: var(--s2);
  font-size: clamp(19px, 2.4vw, 24px);
  color: var(--muted);
  letter-spacing: -0.01em;
}

.console {
  margin-top: var(--s8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s3);
  font-family: var(--mono);
  font-size: 14px;
  overflow-x: auto;
}
.console__prompt { color: var(--muted); margin-bottom: var(--s2); }
.console__ps1 { color: var(--ok); }

.console__table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.console__table th,
.console__table td {
  padding: 6px var(--s3) 6px 0;
  vertical-align: top;
  font-weight: 400;
}
.console__table thead th {
  color: var(--muted);
  padding-bottom: var(--s1);
}
.console__table tbody th { white-space: nowrap; }
.console__table tbody th a {
  color: var(--accent);
  text-decoration: none;
}
.console__table tbody th a:hover { text-decoration: underline; }
.console__table td:nth-child(2) { color: var(--muted); white-space: nowrap; }
.console__table td:last-child { padding-right: 0; }

/* The one motion: site.js prints the rows like command output on first load
   (skipped for prefers-reduced-motion). Without JS the rows are simply visible. */
.console__table tr.is-pending { visibility: hidden; }

/* ---------- Projects ---------- */

.project {
  padding-top: var(--s8);
  padding-bottom: var(--s12);
}
.project__head {
  border-top: 2px solid var(--accent);
  padding-top: var(--s3);
  max-width: 760px;
}
.project__head h2 {
  font-family: var(--mono);
  font-size: clamp(24px, 3.6vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.project__lead {
  margin-top: var(--s1);
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.project__why {
  margin-top: var(--s1);
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  max-width: 62ch;
}

.project__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--s6);
  margin-top: var(--s4);
  align-items: start;
}

.project__copy > p { color: var(--muted); max-width: 64ch; }
.project__copy h3,
.slz-visual h3 {
  margin-top: var(--s4);
  margin-bottom: var(--s2);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.points { display: grid; gap: var(--s2); max-width: 64ch; }
.points li {
  position: relative;
  padding-left: var(--s3);
  color: var(--muted);
}
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 10px;
  height: 2px;
  background: var(--accent);
}
.points strong { color: var(--text); font-weight: 600; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-top: var(--s4);
}
.tags li {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 6px;
  color: var(--text);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s3);
  font-size: 16px;
  align-items: center;
}
.link-primary {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--bg);
  background: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.link-primary:hover { background: color-mix(in srgb, var(--accent) 85%, var(--text)); }

/* Image slot with a fallback when the screenshot is missing */
.shot {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  aspect-ratio: 3 / 2;
}
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.shot__placeholder { display: none; }
.shot--missing img { display: none; }
.shot--missing .shot__placeholder {
  position: absolute;
  inset: var(--s2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  border: 1px dashed var(--border);
  border-radius: 6px;
  background:
    repeating-linear-gradient(-45deg, transparent 0 11px, rgba(255, 255, 255, 0.018) 11px 12px);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.shot--missing .shot__placeholder span:first-child { color: var(--accent); }

/* ---------- secure-landing-zone visual ---------- */

.slz-visual { margin-top: var(--s8); }

.pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--s1);
  counter-reset: step;
}
.pipeline__step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  counter-increment: step;
}
.pipeline__step::before {
  content: counter(step);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
/* connector to the next step */
.pipeline__step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -9px;
  width: 9px;
  height: 1px;
  background: var(--accent);
}
.pipeline__step--gate {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--warn) 55%, var(--border));
}
.pipeline__step--gate::before { color: var(--warn); }
.pipeline__name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.pipeline__detail { font-size: 13px; line-height: 1.4; color: var(--muted); }
.pipeline__detail code { font-size: 12px; padding: 0 4px; }

.artifacts {
  margin-top: var(--s6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.artifacts__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
  padding: var(--s3) var(--s3) var(--s2);
}
.artifacts__head h3 { margin: 0; }
.artifacts__note {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--warn);
}

.tabs__list {
  display: flex;
  gap: 2px;
  padding: 0 var(--s2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs__tab {
  appearance: none;
  flex: none;
  margin: 0;
  padding: 12px var(--s2);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  font: 500 14px/1.2 var(--mono);
  cursor: pointer;
}
.tabs__tab:hover { color: var(--text); }
.tabs__tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tabs__tab:focus-visible { outline-offset: -4px; }

.tabs__panel { padding: var(--s3); }
.tabs__panel:focus-visible { outline-offset: -4px; }
.panel__caption {
  margin-bottom: var(--s2);
  font-size: 14px;
  color: var(--muted);
}

.out {
  margin: 0;
  padding: var(--s2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  tab-size: 2;
}
.out code { font-size: inherit; }
.o-dim { color: var(--muted); }
.o-ok { color: var(--ok); }
.o-bad { color: var(--bad); }
.o-warn { color: var(--warn); }
.o-strong { font-weight: 700; }

.comment, .slack {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--raised);
  overflow: hidden;
}
.comment__meta, .slack__meta {
  padding: 10px var(--s2);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}
.comment__meta strong, .slack__meta strong { color: var(--text); }
.comment__meta span, .slack__meta span {
  margin: 0 4px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
}
.comment__title {
  padding: var(--s2) var(--s2) 0;
  font-weight: 600;
}
.comment .out { margin: var(--s2); }

.slack__body {
  display: grid;
  gap: 12px;
  padding: var(--s2);
  font-size: 15px;
  border-left: 3px solid var(--warn);
  margin: var(--s2);
  background: var(--surface);
  border-radius: 4px;
}

/* ---------- How I build ---------- */

.principles {
  padding-top: var(--s8);
  padding-bottom: var(--s12);
}
.principles h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: var(--s3);
}
.principles__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}
.principles__list li {
  padding: var(--s3) var(--s3) 0 0;
}
.principles__list li + li {
  padding-left: var(--s3);
  border-left: 1px solid var(--border);
}
.principles__list h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--s1);
}
.principles__list p { color: var(--muted); font-size: 16px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
  padding-top: var(--s4);
  padding-bottom: var(--s4);
}
.site-footer a { color: var(--text); }

/* ---------- Writing ---------- */

.post { padding-top: var(--s8); padding-bottom: var(--s12); max-width: 760px; }
.post__back { font-size: 15px; margin-bottom: var(--s4); }
.post__back a, .post__next a, .post-list__link { color: var(--text); }
.post__head h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; }
.post__dek { margin-top: var(--s2); font-size: 20px; line-height: 1.45; color: var(--muted); }
.post__meta { margin-top: var(--s2); font-family: var(--mono); font-size: 13px; color: var(--muted); }
.post__tags { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s2); }
.post__tags li {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
}
.post__body { margin-top: var(--s6); }
.post__body > * + * { margin-top: var(--s2); }
.post__body h2 { margin-top: var(--s6); font-size: 24px; letter-spacing: -0.01em; }
.post__body a { color: var(--info); }
.post__body code { background: var(--raised); border-radius: 4px; padding: 1px 5px; }
.post__list { list-style: disc; padding-left: var(--s3); }
.post__list li + li { margin-top: var(--s1); }
.post__code {
  margin: var(--s3) 0; padding: var(--s2) var(--s3); overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; line-height: 1.5;
}
.post__code code { background: none; padding: 0; font-size: inherit; }
.post__next { margin-top: var(--s8); padding-top: var(--s3); border-top: 1px solid var(--border); }

.post-list { margin-top: var(--s6); display: grid; gap: var(--s2); }
.post-list__link {
  display: block; text-decoration: none; padding: var(--s3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.post-list__link:hover, .post-list__link:focus-visible { border-color: var(--info); }
.post-list__link h2 { font-size: 21px; line-height: 1.3; }
.post-list__link p:not(.post__meta) { margin-top: var(--s1); color: var(--muted); }

@media (max-width: 640px) {
  .post__head h1 { font-size: 30px; }
  .post__dek { font-size: 18px; }
  .post__code { font-size: 12px; padding: var(--s2); }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline__step:nth-child(3n)::after { display: none; }
}

@media (max-width: 820px) {
  .project__body { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .principles__list { grid-template-columns: minmax(0, 1fr); }
  .principles__list li,
  .principles__list li + li {
    padding: var(--s3) 0;
    border-left: 0;
  }
  .principles__list li + li { border-top: 1px solid var(--border); }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding-left: var(--s2); padding-right: var(--s2); }
  .hero { padding-top: var(--s8); padding-bottom: var(--s8); }
  .contact { gap: var(--s2); }
  .project__lead { font-size: 19px; }

  /* Index table stacks into blocks */
  .console { padding: var(--s2); }
  .console__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .console__table, .console__table tbody, .console__table tr,
  .console__table th, .console__table td { display: block; }
  .console__table tbody tr { padding: 12px 0; border-top: 1px solid var(--border); }
  .console__table tbody tr:first-child { border-top: 0; padding-top: 0; }
  .console__table th, .console__table td { padding: 0; white-space: normal; }
  .console__table td:nth-child(2) { white-space: normal; }

  .pipeline { grid-template-columns: minmax(0, 1fr); }
  .pipeline__step {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 12px;
  }
  .pipeline__step::before { width: 1ch; }
  .pipeline__detail { flex-basis: 100%; padding-left: calc(1ch + 12px); }
  .pipeline__step:not(:last-child)::after,
  .pipeline__step:nth-child(3n)::after {
    display: block;
    top: auto;
    bottom: -9px;
    right: auto;
    left: 50%;
    width: 1px;
    height: 9px;
  }
  .artifacts__head, .tabs__panel { padding-left: var(--s2); padding-right: var(--s2); }
  .tabs__list { padding: 0 var(--s1); }
  .tabs__tab { padding: 12px 10px; font-size: 13px; }
  .out { font-size: 12px; }
}

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