/* shahrouz.net — landing + resume page styles. Loaded after base.css. Blog (PaperMod) does not load this. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; }
.mono { font-family: var(--mono); }

/* ---------- landing hero ---------- */
.hero { position: relative; border-bottom: 1px solid var(--rule); overflow: hidden; }
.hero .wrap { position: relative; padding-top: clamp(56px, 10vh, 120px); padding-bottom: clamp(56px, 9vh, 104px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-copy { max-width: 640px; }

/* ---------- hero diagram ---------- */
.topo-wrap { margin: 0; min-width: 0; }
.topo { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--mono); }
.topo .zone-sep { stroke: var(--rule); stroke-dasharray: 2 5; }
.topo .zone-t { font-size: 10px; letter-spacing: .16em; fill: var(--ink-2); font-weight: 500; }
.topo .zone-s { font-size: 8.5px; fill: var(--ink-3); }
.topo .wire { fill: none; stroke: var(--ink-3); stroke-opacity: .34; stroke-width: 1.2; stroke-linecap: round; transition: stroke .3s, stroke-opacity .3s; }
.topo .wire.ext, .topo .wire.ul { stroke-dasharray: 1 4; stroke-opacity: .6; }
.topo .wire.tun { stroke: var(--accent); stroke-opacity: .75; stroke-width: 1.4; stroke-dasharray: 7 5; animation: tun-flow 1.4s linear infinite; }
.topo .wire.down { stroke: #e5484d; stroke-opacity: .7; stroke-dasharray: 3 4; }
.topo .wire.pending { stroke: #e2a336; stroke-opacity: .8; stroke-dasharray: 3 4; }
.topo .glow { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-opacity: 0; stroke-linecap: round; pointer-events: none; }
.topo .hit { fill: none; stroke: transparent; stroke-width: 12; cursor: pointer; }
.topo .glow:has(+ .hit:hover) { stroke-opacity: .7 !important; }
@keyframes tun-flow { to { stroke-dashoffset: -12; } }
.topo .wire.tun + .glow { stroke-dasharray: 7 5; animation: tun-flow 1.4s linear infinite; }

.topo .n .body { fill: var(--bg); stroke: var(--ink-3); stroke-width: 1.2; transition: stroke .25s, fill .25s; }
.topo .n .glyph { fill: none; stroke: var(--ink-2); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; transition: stroke .25s; }
.topo .n.rtr .body, .topo .n.sw .body { stroke: var(--ink-2); }
.topo .n.fwd .body { stroke: var(--accent); }
.topo .n.fwd .glyph { stroke: var(--accent); }
.topo .n.ext .body, .topo .n.site .body { stroke-dasharray: 2 2.5; }
.topo .n.site .body { stroke: var(--accent); stroke-dasharray: none; stroke-opacity: .7; }
.topo .lbl { font-size: 10px; fill: var(--ink-2); }
.topo .pill-t { font-size: 9px; letter-spacing: .08em; fill: var(--ink-2); }
.topo .sub { font-size: 9px; fill: var(--accent); opacity: .8; }

.topo .pk { pointer-events: none; }
.topo .pk > * { display: none; fill: var(--accent); }
.topo .pk.ip .s-ip, .topo .pk.mpls .s-mpls, .topo .pk.vxlan .s-vxlan, .topo .pk.tun .s-tun { display: block; }
.topo .pk .s-mpls { fill: #e2a336; }
.topo .pk .s-tun { fill: var(--bg); stroke: var(--accent); stroke-width: 1.4; }
.topo .pk.drop > * { fill: #e5484d; stroke: #e5484d; animation: pk-drop .45s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes pk-drop { to { opacity: 0; transform: scale(2.6); } }
.topo .x path { stroke: #e5484d; stroke-width: 1.6; stroke-linecap: round; }
.topo .x-bg { fill: var(--bg); stroke: #e5484d; stroke-width: 1; }

.topo-foot { margin-top: 10px; font: 400 11px/1.5 var(--mono); color: var(--ink-3); }
.topo-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0 0 10px; border-bottom: 1px dashed var(--rule); }
.topo-legend li { display: inline-flex; align-items: center; gap: 6px; }
.topo-legend svg { width: 10px; height: 10px; overflow: visible; fill: var(--accent); }
.topo-legend li:nth-child(2) svg { fill: #e2a336; }
.topo-legend .ring { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.topo-legend .leg-down svg { width: 16px; }
.topo-legend .leg-down path { stroke: #e5484d; stroke-dasharray: 3 3; stroke-width: 1.4; fill: none; }
.topo-log { list-style: none; margin: 8px 0 0; padding: 0; min-height: 4.5em; }
.topo-log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: log-in .35s ease-out; }
.topo-log li.sev3 { color: #e5484d; }
.topo-log .ts { color: var(--ink-3); opacity: .7; }
@keyframes log-in { from { opacity: 0; transform: translateY(4px); } }
:root[data-theme="light"] .topo .pk .s-mpls, :root[data-theme="light"] .topo-legend li:nth-child(2) svg { fill: #a15c00; }
:root[data-theme="light"] .topo .wire { stroke-opacity: .55; }
:root[data-theme="light"] .topo .wire.ext, :root[data-theme="light"] .topo .wire.ul { stroke-opacity: .8; }
:root[data-theme="light"] .topo .wire.down { stroke: #c62828; stroke-opacity: .9; stroke-width: 1.5; }
:root[data-theme="light"] .topo .glow { stroke-width: 2.8; }
:root[data-theme="light"] .topo .pk > * { stroke: var(--bg); stroke-width: .8; paint-order: stroke; }
:root[data-theme="light"] .topo .zone-s { fill: var(--ink-2); }
.no-js .topo-foot .topo-log { display: none; }
.prompt { font: 400 13px/1.4 var(--mono); color: var(--ink-3); margin-bottom: 22px; }
.prompt .p { color: var(--accent); }
.hero h1 { font-size: clamp(38px, 5.2vw, 60px); letter-spacing: -.03em; }
.hero .role { font: 400 clamp(15px, 1.6vw, 18px)/1.4 var(--mono); color: var(--accent); margin-top: 14px; }
.hero .lede { font-size: clamp(17px, 1.7vw, 20px); color: var(--ink-2); margin-top: 26px; max-width: 58ch; }
.hero .lede strong { color: var(--ink); font-weight: 500; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--rule); text-decoration: none; font: 500 15px/1 var(--sans); background: var(--bg); color: var(--ink); }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn svg { width: 16px; height: 16px; }
.status { display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; font: 400 13px/1 var(--mono); color: var(--ink-2); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- sections ---------- */
.section { padding: clamp(56px, 9vh, 96px) 0; border-bottom: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(24px, 2.6vw, 30px); }
.section-head .idx { font: 400 13px/1 var(--mono); color: var(--accent); }
.section-head .more { margin-left: auto; font: 400 14px/1 var(--mono); color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.section-head .more:hover { color: var(--accent); }

/* routing-table style focus list */
.rib { width: 100%; border-collapse: collapse; font-size: 15px; }
.rib caption { text-align: left; font: 400 13px/1.5 var(--mono); color: var(--ink-3); padding-bottom: 14px; }
.rib th { text-align: left; font: 400 12px/1 var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; padding: 0 16px 12px 0; border-bottom: 1px solid var(--rule); }
.rib td { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.rib td:first-child { font: 500 14px/1.5 var(--mono); color: var(--accent); white-space: nowrap; width: 1%; padding-right: 28px; }
.rib td:nth-child(2) { font-weight: 500; width: 30%; }
.rib td:last-child { color: var(--ink-2); padding-right: 0; }

/* current role strip */
.now { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.now h3 { font-size: 22px; }
.now .meta { font: 400 13px/1.6 var(--mono); color: var(--ink-3); margin-top: 8px; }
.now ul { list-style: none; display: grid; gap: 12px; color: var(--ink-2); }
.now li { padding-left: 22px; position: relative; }
.now li::before { content: "›"; position: absolute; left: 4px; color: var(--accent); font-family: var(--mono); }

/* posts */
.posts { list-style: none; display: grid; }
.post { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-top: 1px solid var(--rule); }
.post:last-child { border-bottom: 1px solid var(--rule); }
.post time { font: 400 13px/1.9 var(--mono); color: var(--ink-3); }
.post h3 { font-size: 19px; font-weight: 500; letter-spacing: -.005em; }
.post h3 a { text-decoration: none; }
.post h3 a:hover { text-decoration: underline; }
.post p { color: var(--ink-2); font-size: 15px; margin-top: 8px; max-width: 72ch; }
.post .tags { font: 400 12px/1 var(--mono); color: var(--ink-3); margin-top: 12px; }

/* ---------- resume ---------- */
.cv-head { padding: clamp(56px, 9vh, 96px) 0 clamp(40px, 6vh, 64px); border-bottom: 1px solid var(--rule); }
.cv-head h1 { font-size: clamp(36px, 5vw, 56px); letter-spacing: -.03em; }
.cv-head .role { font: 400 16px/1.4 var(--mono); color: var(--accent); margin-top: 12px; }
.cv-head .summary { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 70ch; margin-top: 24px; }
.cv-head .cta { margin-top: 28px; }
.cv-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 0 clamp(24px, 5vw, 64px); }
.cv-block { display: contents; }
.cv-block > h2 { font: 500 13px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); padding: 44px 0; border-top: 1px solid var(--rule); }
.cv-block > h2 span { color: var(--accent); margin-right: 8px; }
.cv-block > .cv-content { padding: 40px 0; border-top: 1px solid var(--rule); }
.cv-block:first-child > h2, .cv-block:first-child > .cv-content { border-top: 0; }

.job + .job { margin-top: 44px; }
.job-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.job-head h3 { font-size: 20px; }
.job-head .when { margin-left: auto; font: 400 13px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
.job .org { color: var(--ink-2); margin-top: 6px; font-size: 15px; }
.job .org b { color: var(--ink); font-weight: 500; }
.job ul { list-style: none; margin-top: 16px; display: grid; gap: 10px; }
.job li { padding-left: 22px; position: relative; color: var(--ink-2); }
.job li::before { content: "›"; position: absolute; left: 4px; color: var(--accent); font-family: var(--mono); }

.conf { margin: 0; font: 400 14px/1.75 var(--mono); background: var(--bg-2); border: 1px solid var(--rule); border-radius: 10px; padding: 22px 24px; overflow-x: auto; white-space: pre-wrap; }
.conf .k { color: var(--accent); }
.conf .c { color: var(--ink-3); }

.list-plain { list-style: none; display: grid; gap: 14px; }
.list-plain li { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.list-plain b { font-weight: 500; }
.list-plain .src { color: var(--ink-2); }
.list-plain .yr { margin-left: auto; font: 400 13px/1 var(--mono); color: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .topo-wrap { max-width: 620px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .now { grid-template-columns: 1fr; }
  .post { grid-template-columns: 1fr; gap: 6px; }
  .rib, .rib tbody, .rib tr, .rib td { display: block; width: auto; }
  .rib thead { display: none; }
  .rib tr { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .rib td { border: 0; padding: 2px 0; }
  .cv-body { grid-template-columns: 1fr; }
  .cv-block > h2 { padding: 36px 0 0; }
  .cv-block > .cv-content { border-top: 0; padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .topo-log { display: none; }
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ---------- print (resume) ---------- */
@media print {
  :root, :root:not([data-theme="light"]) { --bg: #fff; --bg-2: #fff; --ink: #000; --ink-2: #222; --ink-3: #555; --rule: #ccc; --accent: #0b5d3f; color-scheme: light; }
  body { font-size: 10.5pt; line-height: 1.45; }
  .site-head, .site-foot, .cta, .term, .skip, .no-print { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .cv-head { padding: 0 0 12pt; }
  .cv-head h1 { font-size: 24pt; }
  .cv-body { grid-template-columns: 1fr; }
  .cv-block > h2 { padding: 12pt 0 4pt; border-top: 1px solid var(--rule); }
  .cv-block > .cv-content { padding: 0 0 4pt; border-top: 0; }
  .job + .job { margin-top: 12pt; }
  .job, .list-plain li { break-inside: avoid; }
  .conf { border: 0; padding: 0; font-size: 9pt; }
  a { text-decoration: none; }
}
