/* Field Log: the DevSecOps blog at blogs.aditya-khanal.com.np
   Same family as the portfolio (slate, amber, Space Grotesk), tuned for long reading. */

:root {
  --bg: #0d141d;
  --panel: #131d29;
  --panel-2: #192535;
  --well: #080d13;
  --line: #26364b;
  --ink: #e9eef4;
  --ink-2: #b3c0cf;
  --ink-3: #7f8ea2;
  --amber: #f5b13d;
  --hostile: #ff6b5e;
  --ok: #4fd1a5;
  --c: var(--amber);           /* phase colour, set per element below */
  --sans: "Space Grotesk", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --wrap: 1180px;
  --measure: 70ch;
  color-scheme: dark;
}

[data-color="edge"]       { --c: #f5b13d; }
[data-color="supply"]     { --c: #4fd1a5; }
[data-color="cicd"]       { --c: #7aa2ff; }
[data-color="containers"] { --c: #c792ea; }
[data-color="k8s"]        { --c: #ff8f6b; }
[data-color="cloud"]      { --c: #5fd4e8; }
[data-color="detect"]     { --c: #ff6b5e; }
[data-color="ai"]         { --c: #e4e86a; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgb(245 177 61 / .07), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgb(79 209 165 / .05), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body::before {               /* faint drafting grid, same as the portfolio */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / .025) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(#000, transparent 70%);
}

a { color: var(--amber); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; display: block; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--amber); color: var(--bg); padding: .5rem .8rem; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header and footer ---------- */
.top, .foot, main > section, .post { width: min(var(--wrap), 100% - 2rem); margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; fill: none; stroke: var(--amber); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.top nav { display: flex; gap: 1.25rem; }
.top nav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.top nav a:hover { color: var(--ink); }
.foot { border-top: 1px solid var(--line); margin-top: 5rem; padding: 2rem 0 3rem; color: var(--ink-3); font-size: .9rem; }
.foot p { margin: .25rem 0; }
.foot a { color: var(--ink-2); }

/* ---------- Home ---------- */
.intro { padding: clamp(2.5rem, 7vw, 5.5rem) 0 2rem; }
.kicker { color: var(--ink-3); margin: 0 0 1rem; font-size: .95rem; }
.intro h1 {
  font-size: clamp(2.3rem, 5.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 600;
  margin: 0;
  max-width: 17ch;
  text-wrap: balance;
}
.intro .lede { font: 400 1.25rem/1.55 var(--serif); color: var(--ink-2); max-width: 60ch; margin: 1.5rem 0 1rem; }
.progress { color: var(--ink-3); margin: 0; }
.progress strong { color: var(--ink); font-weight: 600; }

/* The route: one transit line per phase, one stop per day. */
.route-wrap { padding: 1.5rem 0 1rem; }
.route { display: flex; flex-wrap: wrap; gap: 1.25rem 0; }
.seg { flex: 1 1 30%; min-width: 0; }
@media (min-width: 1100px) {
  /* One continuous line on wide screens; each phase is as long as its number of days. */
  .route { flex-wrap: nowrap; }
  .seg { flex: 0 1 0; }
  .seg.n5 { flex-grow: 5; } .seg.n7 { flex-grow: 7; } .seg.n8 { flex-grow: 8; }
  .seg.n9 { flex-grow: 9; } .seg.n10 { flex-grow: 10; }
  .stops li { padding: 0 1px; }
}
.seg-name { margin: 0 0 .55rem; padding-right: 1rem; font-size: .8rem; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stops { list-style: none; margin: 0; padding: 0; display: flex; position: relative; }
.stops::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: var(--c); opacity: .35; }
.stops li { flex: 1 0 auto; display: flex; justify-content: center; position: relative; padding: 0 3px; }
.stop {
  display: block; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
  position: relative; cursor: default;
}
.stop.done { background: var(--c); border-color: var(--c); cursor: pointer; }
.stop.done:hover { transform: scale(1.25); }
.stop.now, .stop.here { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--amber); }
.stop.now::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid var(--amber); opacity: 0;
  animation: ping 2.4s ease-out 0.4s 3;
}
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
.route-tip { min-height: 1.6em; margin: 1rem 0 0; color: var(--ink-2); font-size: .95rem; }

.latest { padding: 2.5rem 0 1rem; }
.latest-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1rem, 4vw, 3rem); align-items: center;
  text-decoration: none; color: var(--ink);
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 18px;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / .6);
  position: relative; overflow: hidden;
}
.latest-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.latest-card:hover { border-color: color-mix(in srgb, var(--c) 60%, var(--line)); }
.big-num {
  font: 700 clamp(5rem, 14vw, 10rem)/.8 var(--sans); letter-spacing: -.06em;
  color: var(--c); font-variant-numeric: tabular-nums;
}
.latest-body { display: grid; gap: .6rem; }
.latest-card h2 { margin: 0; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 600; text-wrap: balance; }
.latest-card .summary { font: 400 1.1rem/1.55 var(--serif); color: var(--ink-2); max-width: 62ch; }
.meta { color: var(--ink-3); font-size: .9rem; }
.phase-chip {
  justify-self: start; margin: 0;
  font-size: .8rem; font-weight: 500; color: var(--c);
  padding: .2rem .65rem; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}

.itinerary { padding: 4rem 0 0; }
.itinerary > h2 { font-size: 1.6rem; letter-spacing: -.02em; margin: 0 0 1.5rem; font-weight: 600; }
.phases { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1rem; }
.phase { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem 1.25rem 1rem; border-top: 3px solid var(--c); }
.phase h3 { margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.blurb { margin: .3rem 0 1rem; color: var(--ink-3); font-size: .92rem; }
.days { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.days li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .5rem; padding: .35rem 0; border-top: 1px solid rgb(255 255 255 / .04); font-size: .95rem; line-height: 1.4; }
.dn { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.days .done .dn { color: var(--c); font-weight: 600; }
.days .done a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--c) 60%, transparent); }
.days .soon span:last-child { color: var(--ink-3); }

/* Earlier days: newest first, up to six, after the latest card */
.recent { padding: 3rem 0 0; }
.recent > h2 { font-size: 1.6rem; letter-spacing: -.02em; margin: 0 0 1rem; font-weight: 600; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 1rem; }
.recent-list a {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem 1rem; height: 100%;
  padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  color: var(--ink); text-decoration: none;
}
.recent-list a:hover { border-color: color-mix(in srgb, var(--c) 60%, var(--line)); }
.rn { grid-row: span 3; font: 700 2.4rem/1 var(--sans); color: var(--c); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.rt { font-weight: 600; line-height: 1.3; }
.rs { font: 400 1rem/1.5 var(--serif); color: var(--ink-2); }
.more { color: var(--ink-3); margin: 1rem 0 0; }

/* Published posts as clickable boxes, newest first */
.posts { padding: 2.5rem 0 0; }
.posts > h2 { font-size: 1.6rem; letter-spacing: -.02em; margin: 0 0 1.25rem; font-weight: 600; }
.post-boxes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 1rem; }
.box {
  display: grid; gap: .55rem; align-content: start; height: 100%;
  padding: 1.4rem 1.5rem 1.3rem; border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 14px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  color: var(--ink); text-decoration: none;
  box-shadow: 0 24px 48px -32px rgb(0 0 0 / .7);
  transition: border-color .15s ease, transform .15s ease;
}
.box:hover { border-color: color-mix(in srgb, var(--c) 65%, var(--line)); transform: translateY(-2px); }
.box-day { font: 700 1rem/1 var(--sans); color: var(--c); }
.box-title { font: 600 1.3rem/1.25 var(--sans); letter-spacing: -.015em; text-wrap: balance; }
.box-sum { font: 400 1.02rem/1.55 var(--serif); color: var(--ink-2); }
.more { color: var(--ink-3); margin: 1.25rem 0 0; }
@media (prefers-reduced-motion: reduce) { .box, .box:hover { transition: none; transform: none; } }

/* ---------- Post ---------- */
.post { padding-top: clamp(1.5rem, 5vw, 4rem); }
.post-head { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2.5rem; align-items: start; margin-bottom: 3rem; }
.day-mark {
  margin: 0; font: 700 clamp(4.5rem, 9vw, 8rem)/.85 var(--sans); letter-spacing: -.06em;
  color: var(--c); font-variant-numeric: tabular-nums; display: grid;
}
.day-mark .of { font-size: .9rem; letter-spacing: 0; font-weight: 500; color: var(--ink-3); line-height: 1.4; }
.day-mark .of:last-child { margin-top: .6rem; }
.head-text { display: grid; gap: 1rem; max-width: 52rem; }
.post-head h1 { margin: 0; font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.05; letter-spacing: -.03em; font-weight: 600; text-wrap: balance; }
.post-head .lede { margin: 0; font: 400 1.28rem/1.55 var(--serif); color: var(--ink-2); max-width: 60ch; }
.tags { display: inline-flex; flex-wrap: wrap; gap: .4rem; margin-left: .75rem; vertical-align: middle; }
.tags span { font-size: .78rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .55rem; }

.post-grid { display: grid; grid-template-columns: 220px minmax(0, var(--measure)); gap: 2.5rem; }
.rail { position: relative; }
.toc { position: sticky; top: 1.5rem; font-size: .88rem; }
.rail-h { color: var(--ink-3); margin: 0 0 .6rem; }
.toc ol { list-style: none; margin: 0; padding: 0 0 0 .9rem; border-left: 1px solid var(--line); display: grid; gap: .45rem; }
.toc a { color: var(--ink-3); text-decoration: none; display: block; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current] { color: var(--c); }

.prose { font: 400 1.18rem/1.72 var(--serif); color: #dbe3ec; min-width: 0; }
.prose > * { margin-top: 0; margin-bottom: 1.3rem; }
.prose h2 { font: 600 1.7rem/1.2 var(--sans); letter-spacing: -.02em; color: var(--ink); margin: 3.2rem 0 1rem; position: relative; }
.prose h3 { font: 600 1.25rem/1.3 var(--sans); color: var(--ink); margin: 2.2rem 0 .7rem; }
.anchor { position: absolute; left: -1.2em; color: var(--ink-3); text-decoration: none; opacity: 0; }
.prose h2:hover .anchor { opacity: 1; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .35rem 0; }
.prose li::marker { color: var(--c); }
.prose :not(pre) > code {
  font: 400 .84em var(--mono); color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: .08em .35em;
}
.prose blockquote { margin-left: 0; padding-left: 1.2rem; border-left: 3px solid var(--c); color: var(--ink-2); font-style: italic; }

/* Callouts */
.note, .warn, .try {
  font: 400 1.02rem/1.6 var(--sans); color: var(--ink-2);
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--ink-3);
  border-radius: 10px; padding: 1rem 1.2rem;
}
.note p, .warn p, .try p { margin: 0 0 .5rem; }
.note p:last-child, .warn p:last-child, .try p:last-child { margin: 0; }
.note b, .warn b, .try b { color: var(--ink); font-weight: 600; }
.note { border-left-color: var(--ok); }
.warn { border-left-color: var(--hostile); }
.try  { border-left-color: var(--amber); }

/* Code and terminal figures */
figure { margin: 0 0 1.6rem; }
figure.code, figure.term { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--well); box-shadow: 0 20px 40px -24px rgb(0 0 0 / .7); }
figure.code figcaption, figure.term figcaption {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .55rem .9rem; background: var(--panel); border-bottom: 1px solid var(--line);
  font: 500 .8rem var(--mono); color: var(--ink-3);
}
figure.term figcaption { justify-content: flex-start; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #2c3b50; }
.dots i:first-child { background: #ff6b5e; } .dots i:nth-child(2) { background: #f5b13d; } .dots i:last-child { background: #4fd1a5; }
.file { color: var(--ink-2); }
.copy {
  font: 500 .75rem var(--mono); color: var(--ink-2); background: transparent;
  border: 1px solid var(--line); border-radius: 6px; padding: .2rem .55rem; cursor: pointer;
}
.copy:hover { color: var(--ink); border-color: var(--ink-3); }
figure pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; font: 400 .86rem/1.65 var(--mono); color: #d6deea; tab-size: 2; }
figure pre:focus-visible { outline-offset: -3px; }
.term .ps { color: var(--ok); user-select: none; }
.term .cmd { color: var(--ink); }
.term .out { color: #9fb0c3; }
.term .c { color: var(--ink-3); font-style: italic; }
.term .hl, .term mark { color: var(--amber); background: none; }

/* Pygments token colours (nowrap classes) */
.code .c, .code .c1, .code .cm, .code .ch, .code .cs, .code .cp { color: #6f8197; font-style: italic; }
.code .k, .code .kd, .code .kn, .code .kr, .code .kc, .code .kt, .code .ow { color: #c792ea; }
.code .s, .code .s1, .code .s2, .code .sh, .code .sb, .code .sd, .code .se, .code .si, .code .sa, .code .dl { color: #a5e08f; }
.code .nt, .code .nl { color: #7aa2ff; }
.code .na, .code .py { color: #f5b13d; }
.code .nb, .code .bp, .code .nf, .code .fm { color: #5fd4e8; }
.code .nv, .code .vi, .code .vg, .code .no { color: #ff8f6b; }
.code .m, .code .mi, .code .mf, .code .mh, .code .il, .code .l, .code .ld { color: #ffcf7a; }
.code .o, .code .p { color: #9fb0c3; }
.code .gp { color: var(--ok); }
.code .go { color: #9fb0c3; }
.code .err { color: var(--hostile); background: none; }

/* Screenshots and diagrams */
figure.shot, figure.diagram { border-radius: 12px; }
figure.shot img { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 30px 60px -30px rgb(0 0 0 / .8); }
figure.diagram img { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
figure.shot figcaption, figure.diagram figcaption { font: 400 .9rem/1.5 var(--sans); color: var(--ink-3); margin-top: .7rem; }
.prose .wide { margin-right: calc(-1 * min(12vw, 160px)); }

/* Tables */
.tbl { width: 100%; overflow-x: auto; margin-bottom: 1.6rem; border: 1px solid var(--line); border-radius: 12px; }
.tbl table { width: 100%; border-collapse: collapse; font: 400 .93rem/1.45 var(--sans); }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: .65rem .9rem; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { color: var(--ink); font-weight: 600; background: var(--panel); }
.tbl td { color: var(--ink-2); }
.tbl td:first-child { color: var(--ink); }

/* Checklist */
.check { list-style: none; padding-left: 0 !important; font: 400 1.02rem/1.5 var(--sans); }
.check li { position: relative; padding-left: 2rem; margin: .6rem 0; color: var(--ink-2); }
.check li::before {
  content: ""; position: absolute; left: 0; top: .15em; width: 1.1rem; height: 1.1rem;
  border: 2px solid var(--ok); border-radius: 4px;
  background: linear-gradient(45deg, transparent 45%, var(--ok) 45% 55%, transparent 55%) no-repeat,
              color-mix(in srgb, var(--ok) 12%, transparent);
}

/* Series navigation */
.next-prev { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 4rem 0 2rem; }
.np { display: grid; gap: .3rem; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-decoration: none; color: var(--ink); }
.np.next { text-align: right; }
.np-l { color: var(--ink-3); font-size: .85rem; }
.np-t { font-weight: 500; line-height: 1.35; }
.np.soon .np-t { color: var(--ink-2); }
a.np:hover { border-color: var(--amber); }
.route-wrap.compact { width: auto; border-top: 1px solid var(--line); padding-top: 2rem; }

.notfound { min-height: 50vh; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .post-head { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .day-mark { display: flex; align-items: baseline; gap: .5rem; font-size: 3.6rem; }
  .day-mark .of:last-child { margin: 0; }
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .prose .wide { margin-right: 0; }
}
@media (max-width: 640px) {
  .top nav { gap: .9rem; }
  .top nav a { font-size: .88rem; }
  .brand span { display: none; }
  .latest-card { grid-template-columns: minmax(0, 1fr); }
  .big-num { font-size: 4.5rem; }
  .prose { font-size: 1.1rem; }
  .next-prev { grid-template-columns: minmax(0, 1fr); }
  .np.next { text-align: left; }
  .tags { margin: .4rem 0 0; display: flex; }
  .seg { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .stop.now::after { animation: none; }
  .stop.done:hover { transform: none; }
}
