/* ============================================================
   jimkirk.org - design v2 (P3-15), iteration 3
   LCARS amber + Chakra Petch, HUD brackets, hero portrait.
   Loaded AFTER main.css. Preview-only lab lives in design-lab.js.
   ============================================================ */

:root {
  --bg:            #131a24;
  --bg-elev:       #1a2331;
  --bg-elev-2:     #222d3e;
  --bg-deep:       #0e141c;
  --ink:           #dde4ee;
  --ink-dim:       #9aa7b8;
  --ink-faint:     #6b7a8e;
  --line:          #26313f;
  --line-soft:     #1d2633;

  --sans:          "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif:         "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --mono:          "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --display:       "Chakra Petch", "IBM Plex Sans", var(--sans);

  --maxw:          1080px;
  --radius:        10px;
  --shadow:        0 18px 50px rgba(0, 0, 0, .38);
}

/* ---- LCARS amber accent (fixed) ---- */
html {
  --accent:       #ff9f1c;   /* LCARS amber */
  --accent-ink:   #ffc879;
  --accent-soft:  rgba(255, 159, 28, .14);
  --accent-glow:  rgba(255, 159, 28, .20);
}

/* ---- display face (fixed) ---- */

/* ---- dark theme token overrides (beat _default_dark.scss) --- */
html[data-theme="dark"] {
  --global-bg-color:                 var(--bg);
  --global-footer-bg-color:          var(--bg-deep);
  --global-text-color:               var(--ink);
  --global-text-color-light:         var(--ink-dim);
  --global-link-color:               var(--accent-ink);
  --global-link-color-hover:         #ffffff;
  --global-link-color-visited:       var(--accent-ink);
  --global-base-color:               var(--accent);
  --global-border-color:             var(--line);
  --global-dark-border-color:        var(--line-soft);
  --global-masthead-link-color:      var(--ink);
  --global-masthead-link-color-hover: var(--accent);
  --global-code-background-color:    var(--bg-deep);
  --global-code-text-color:          #cdd6e2;
  --global-thead-color:              var(--bg-elev);
  --global-fig-caption-color:        var(--ink-faint);
  color-scheme: dark;
}

html, body { background-color: var(--bg); }

body {
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- typography -------------------------------------------- */
.hero__title, .page__content h1, .page__content h2, .page__content h3,
.archive h1, .archive h2, .archive h3, .page__title,
.archive__item-title, .log-item__title {
  font-family: var(--display);
}
.page__content h1, .page__content h2, .page__content h3,
.archive h1, .archive h2, .archive h3 { color: var(--ink); letter-spacing: -.01em; }
.page__content h1 { font-weight: 600; }
.page__content h2 { font-weight: 600; padding-bottom: .35rem; border-bottom: 1px solid var(--line-soft); }
.page__content p, .page__content li { color: var(--ink); }
.page__content a:not(.btn) { color: var(--accent-ink); text-decoration: none; }
.page__content a:not(.btn):hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}
code, pre, kbd, samp { font-family: var(--mono); }
pre { background: var(--bg-deep) !important; border: 1px solid var(--line-soft); border-radius: var(--radius); }
:not(pre) > code {
  background: var(--bg-elev) !important; color: var(--accent-ink) !important;
  border: 1px solid var(--line-soft); border-radius: 6px; padding: .1em .38em;
}
hr { border: 0; border-top: 1px solid var(--line-soft); }

/* ---- masthead / nav ---------------------------------------- */
.masthead {
  background: rgba(19, 26, 36, .86) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.masthead__menu-item a { color: var(--ink) !important; font-size: .95rem; letter-spacing: .01em; }
.masthead__menu-item a:hover { color: var(--accent) !important; }
.masthead__menu-item--lg a { font-family: var(--sans); font-weight: 600; letter-spacing: .02em; font-size: 1.02rem !important; }
.masthead__menu-item--lg a::before {
  content: "\2726"; color: var(--accent); margin-right: .5em; font-size: .8em; vertical-align: .08em;
}
.masthead__menu-item.selected > a { color: var(--accent-ink) !important; }
.masthead__menu-item.selected::after { background: var(--accent) !important; height: 2px !important; }

/* ---- hero -------------------------------------------------- */
.hero {
  position: relative;
  min-height: 76vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(45% 60% at 16% 18%, rgba(255, 159, 28, .06), transparent 70%),
    radial-gradient(50% 60% at 86% 76%, rgba(255, 255, 255, .03), transparent 70%),
    radial-gradient(130% 100% at 72% 6%, #1c2536 0%, #151d29 44%, #0e141c 100%);
}
.hero__sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero__stars, .hero__stars2, .hero__stars3 { position: absolute; inset: -60%; background-repeat: repeat; will-change: transform; }

.hero__stars {
  background-image:
    radial-gradient(1.6px 1.6px at 20px 30px, rgba(255,255,255,.95), transparent 60%),
    radial-gradient(1.5px 1.5px at 130px 82px, rgba(255,255,255,.80), transparent 60%),
    radial-gradient(1.4px 1.4px at 78px 158px, rgba(255,255,255,.90), transparent 60%),
    radial-gradient(1.2px 1.2px at 176px 44px, rgba(255,255,255,.70), transparent 60%),
    radial-gradient(1.2px 1.2px at 44px 122px, rgba(255,255,255,.60), transparent 60%),
    radial-gradient(1.1px 1.1px at 150px 178px, rgba(255,255,255,.55), transparent 60%);
  background-size: 200px 200px;
  opacity: .9;
  animation: drift-a 40s linear infinite;
}
.hero__stars2 {
  background-image:
    radial-gradient(2px 2px at 60px 40px, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(1.6px 1.6px at 180px 140px, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(1.8px 1.8px at 240px 90px, rgba(255,255,255,.70), transparent 60%),
    radial-gradient(1.4px 1.4px at 300px 200px, rgba(255,255,255,.6), transparent 60%);
  background-size: 340px 340px;
  opacity: .55;
  animation: drift-b 70s linear infinite;
}
.hero__stars3 {
  background-image:
    radial-gradient(2.6px 2.6px at 100px 200px, rgba(255,255,255,.95), transparent 65%),
    radial-gradient(2.2px 2.2px at 320px 60px, rgba(255,255,255,.75), transparent 65%);
  background-size: 480px 480px;
  opacity: .5;
  animation: twinkle 4.5s ease-in-out infinite alternate, drift-a 90s linear infinite;
}
.hero__planet {
  position: absolute;
  right: -7%;
  bottom: -42%;
  width: 40vw;
  height: 40vw;
  max-width: 520px;
  max-height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #3c4350 0%, #232a36 46%, #10151c 75%);
  box-shadow: inset -30px -40px 80px rgba(0,0,0,.70),
              inset 8px 10px 40px var(--accent-glow),
              0 0 120px rgba(255,255,255,.04);
  opacity: .9;
}
.hero__orbit {
  position: absolute;
  right: -11%;
  bottom: -46%;
  width: 49vw;
  height: 49vw;
  max-width: 640px;
  max-height: 640px;
  border: 1px solid var(--accent-soft);
  border-radius: 50%;
  transform: rotate(-14deg);
}
.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 5.5rem 2rem 5rem;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3rem;
  align-items: center;
}
.hero__eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 1.2rem;
}
.hero__title {
  font-size: clamp(2.8rem, 6.6vw, 4.8rem);
  line-height: .98; letter-spacing: -.015em; font-weight: 600;
  color: #f3f6fb; margin: 0 0 1.2rem; text-wrap: balance;
}
.hero__lede {
  font-family: var(--serif);
  font-style: normal;
  font-size: clamp(1.06rem, 1.55vw, 1.24rem);
  line-height: 1.62;
  color: var(--ink-dim);
  max-width: 30rem;
  margin: 0 0 2rem;
}
.hero__cta { display: flex; gap: .8rem; flex-wrap: wrap; }

/* hero portrait medallion */
.hero__portrait-wrap {
  position: relative;
  justify-self: end;
  width: clamp(140px, 17vw, 205px);
  aspect-ratio: 1;
}
.hero__portrait-frame {
  position: relative; width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden; z-index: 2;
  box-shadow: 0 0 0 1px var(--accent-soft), 0 24px 60px rgba(0,0,0,.55);
}
.hero__portrait { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.95) contrast(1.02); }
.hero__portrait-frame::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: inset 0 -40px 70px rgba(8, 12, 18, .45); pointer-events: none;
}
.hero__portrait-wrap::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 1px solid var(--accent-soft);
}
.hero__portrait-wrap::after {
  content: ""; position: absolute; inset: -20px; border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.06);
}

/* ---- Trek dial: "More" (brackets + ticks) ------------------ */
html.trek-more .hero__inner::before,
html.trek-more .hero__inner::after {
  content: ""; position: absolute; width: 34px; height: 34px;
  border: 2px solid var(--accent); opacity: .32; z-index: 2;
}
html.trek-more .hero__inner::before { top: .4rem; left: .4rem; border-right: 0; border-bottom: 0; }
html.trek-more .hero__inner::after  { bottom: .4rem; right: .4rem; border-left: 0; border-top: 0; }
html.trek-more .section-label::before { content: "// "; color: var(--accent); opacity: .8; }

/* motion */
@keyframes drift-a { from { transform: translate3d(0,0,0); } to { transform: translate3d(-120px,-220px,0); } }
@keyframes drift-b { from { transform: translate3d(0,0,0); } to { transform: translate3d(90px,-160px,0); } }
@keyframes twinkle { from { opacity: .18; } to { opacity: .5; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hero__eyebrow, .hero__title, .hero__lede, .hero__cta, .hero__portrait-wrap { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.hero__title { animation-delay: .08s; }
.hero__lede  { animation-delay: .18s; }
.hero__cta   { animation-delay: .28s; }
.hero__portrait-wrap { animation-delay: .12s; }

/* ---- buttons ----------------------------------------------- */
.btn, .btn--primary {
  display: inline-block; padding: .72rem 1.35rem; border-radius: 999px;
  font-family: var(--display); font-size: .95rem; font-weight: 600; letter-spacing: .02em;
  text-decoration: none; border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary, .btn--primary { background: var(--accent); color: #17120a !important; box-shadow: 0 6px 24px var(--accent-glow); }
.btn-primary:hover, .btn--primary:hover { background: var(--accent-ink); transform: translateY(-1px); color: #17120a !important; }
.btn-ghost, .btn--light-outline { background: transparent; color: var(--ink) !important; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink) !important; transform: translateY(-1px); }

/* ---- home sections ----------------------------------------- */
.home-section { padding: 4.5rem 0 3.5rem; }
.home-section .wrapper { max-width: var(--maxw); margin: 0 auto; padding: 0 2rem; }
.section-label {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 1.8rem; border: 0; padding: 0;
}
.log-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.log-item { border-bottom: 1px solid var(--line-soft); }
.log-item__link {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: .3rem 1.4rem;
  padding: 1.15rem 0; text-decoration: none; align-items: baseline;
  transition: background .15s ease, padding-left .15s ease;
}
.log-item__link:hover { background: var(--bg-elev); padding-left: .8rem; border-radius: 8px; }
.log-item__date { font-family: var(--mono); font-size: .78rem; color: var(--ink-faint); letter-spacing: .04em; white-space: nowrap; }
.log-item__title { color: var(--ink); font-size: 1.14rem; font-weight: 600; line-height: 1.35; }
.log-item__link:hover .log-item__title { color: var(--accent-ink); }
.log-item__excerpt { grid-column: 2; color: var(--ink-dim); font-size: .93rem; line-height: 1.5; }
.log-more { margin: 1.8rem 0 0; }
.log-more a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.log-more a:hover { color: #fff; }

/* about brief at the foot of the landing */

/* ---- inner pages ------------------------------------------- */
.sidebar { opacity: 1; }
.author__avatar img { border-radius: 50%; filter: contrast(1.03); }
.author__name { color: var(--ink) !important; font-family: var(--display); font-weight: 600; }
.author__bio { color: var(--ink-dim) !important; }
.author__urls { border-color: var(--line-soft) !important; }
.author__urls a { color: var(--ink-dim) !important; }
.author__urls a:hover { color: var(--accent) !important; }
.author__urls-wrapper button { background: transparent; border-color: var(--line) !important; color: var(--ink-dim) !important; }

.archive__item-title a { color: var(--ink) !important; font-weight: 600; }
.archive__item-title a:hover { color: var(--accent-ink) !important; }
.archive__item-excerpt, .archive__item-teaser { color: var(--ink-dim); }
.list__item { border-bottom: 1px solid var(--line-soft); }
.page__meta, .page__date { color: var(--ink-faint) !important; }

table { border-color: var(--line-soft) !important; }
thead { background: var(--bg-elev) !important; }
th, td { border-color: var(--line-soft) !important; }
.notice, .notice--info, .notice--warning, .notice--danger, .notice--success {
  border-radius: var(--radius); border: 1px solid var(--line-soft); background: var(--bg-elev); color: var(--ink);
}

.page__footer { background: var(--bg-deep) !important; border-top: 1px solid var(--line-soft); color: var(--ink-faint); }
.page__footer a { color: var(--ink-dim) !important; }
.page__footer a:hover { color: var(--accent) !important; }
.page__footer-copyright { color: var(--ink-faint); }

/* ---- responsive -------------------------------------------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .hero__portrait-wrap { justify-self: start; width: min(32vw, 150px); order: -1; }
}
@media (max-width: 640px) {
  .hero { min-height: 64vh; }
  .hero__inner { padding: 3.5rem 1.25rem 3rem; }
  .hero__portrait-wrap { width: min(30vw, 130px); }
  .hero__planet { width: 70vw; height: 70vw; right: -26%; bottom: -34%; }
  .log-item__link { grid-template-columns: 1fr; gap: .25rem; }
  .log-item__excerpt { grid-column: 1; }
}

/* ---- reduced motion ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero__stars, .hero__stars2, .hero__stars3,
  .hero__eyebrow, .hero__title, .hero__lede, .hero__cta, .hero__portrait-wrap { animation: none !important; }
  .hero__stars3 { opacity: .4; }
}/* ============================================================
   Iteration 4: inner pages (Posts, Portfolio, Resume, About)
   Appended after the core design tokens in design.css.
   ============================================================ */

/* consistent page header */
.page__title { position: relative; padding-top: 1.1rem; }
.page__title::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 44px; height: 2px; background: var(--accent);
}

/* lead line used on The Log and Portfolio */
.log-lead {
  color: var(--ink-dim);
  max-width: 40rem;
  margin: -.4rem 0 2.2rem;
  font-size: 1.02rem;
  line-height: 1.6;
}

/* year group headings on The Log */
.archive__subtitle {
  font-family: var(--mono) !important;
  font-size: 1.06rem !important;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent) !important;
  margin: 2.6rem 0 1.1rem !important;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 600 !important;
}

/* log entries */
.log-entry { border-bottom: 1px solid var(--line-soft); }
.log-entry__link,
.log-entry__link:link,
.log-entry__link:visited,
.log-entry__link * { text-decoration: none !important; }
.log-entry__link {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: .25rem 1.2rem;
  padding: 1rem 0;
  text-decoration: none;
  align-items: baseline;
  transition: background .15s ease, padding-left .15s ease;
}
.log-entry__link:hover { background: var(--bg-elev); padding-left: .7rem; border-radius: 8px; }
.log-entry__date { font-family: var(--mono); font-size: .76rem; color: var(--ink-faint); letter-spacing: .03em; }
.log-entry__title { display: block; font-family: var(--display); font-size: 1.12rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
.log-entry__link:hover .log-entry__title { color: var(--accent-ink); }
.log-entry__excerpt { display: block; color: var(--ink-dim); font-size: .92rem; line-height: 1.5; margin-top: .15rem; }

/* document lists (Portfolio) */
.doc-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: .1rem 1.8rem;
}
.doc-list li { border-bottom: 1px solid var(--line-soft); }
.doc-list a {
  display: flex; align-items: baseline; gap: .55rem;
  padding: .55rem 0; color: var(--ink); text-decoration: none; line-height: 1.4;
}
.doc-list a::before { content: "\2197"; color: var(--accent); font-size: .8em; flex: 0 0 auto; }
.doc-list a:hover { color: var(--accent-ink); }
.doc-list a:hover::before { color: var(--accent-ink); }

/* resume / CV tightening */
.page__content h2 { color: var(--ink) !important; }
.page__content h2 + hr { border: 0; height: 2px; width: 52px; background: var(--accent); margin: .15rem 0 1.3rem; }
.page__content hr { border-top: 1px solid var(--line-soft); }
.archive h2:not(.archive__subtitle) { border-bottom: none !important; }
.archive h2:not(.archive__subtitle) + hr { border: 0; height: 2px; width: 52px; background: var(--accent); margin: .15rem 0 1.3rem; }
.archive hr { border-top: 1px solid var(--line-soft); }
.page__content ul { margin-left: 1.1rem; }
.page__content li { margin-bottom: .35rem; }
.page__content strong { color: var(--ink); }

/* responsive */
@media (max-width: 720px) {
  .doc-list { grid-template-columns: 1fr; }
  .log-entry__link { grid-template-columns: 1fr; gap: .2rem; }
}

/* center content on pages that drop the sidebar (Portfolio, Resume, Search) */
body:not(:has(.sidebar)) .archive,
body:not(:has(.sidebar)) .page {
  float: none;
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

/* search page */
.search-wrap { max-width: 46rem; }
.search-input {
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  padding: .85rem 1.05rem;
  font-family: var(--sans);
  font-size: 1.02rem;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="search"].search-input { box-sizing: border-box; max-width: 100%; }
.search-input::placeholder { color: var(--ink-faint); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-hint { color: var(--ink-faint); font-size: .84rem; margin: .8rem 0 1.4rem; }
.search-results { list-style: none; margin: 0; padding: 0; }
.search-result { border-bottom: 1px solid var(--line-soft); }
.search-result a { display: block; padding: .9rem 0; text-decoration: none; }
.search-result__title { display: block; font-family: var(--display); font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.search-result a:hover .search-result__title { color: var(--accent-ink); }
.search-result__meta { display: block; font-family: var(--mono); font-size: .74rem; color: var(--ink-faint); margin: .15rem 0; }
.search-result__excerpt { display: block; color: var(--ink-dim); font-size: .92rem; line-height: 1.5; }

/* nav consistency + search icon */
.masthead__menu-item a { font-family: var(--sans); }
.masthead__search a { display: inline-flex; align-items: center; padding: .15rem .25rem; }
.masthead__search svg { width: 18px; height: 18px; display: block; transition: transform .15s ease; }
.masthead__search a:hover svg { transform: scale(1.1); }
/* ---- Resume PDF (tools/resume-pdf) -------------------------------------
   .resume-print-head is the letterhead of the generated PDF; on screen the
   page's own heading does that job, so it stays hidden. The resume page
   deliberately carries no link to the PDF: Jim uses it for applications, a
   visitor gets the HTML page. */
@media screen {
  .resume-print-head { display: none; }
}
