/* =========================================================================
   Stephen Osmond — editorial / cinematic direction, take 1
   Fonts: Fraunces (display, variable, italic) + JetBrains Mono (terminal)
   Palette pulled from the portrait: charcoal / cream / muted teal
   ========================================================================= */

:root {
  --bg:         #0a0d0f;
  --bg-2:       #0f1417;
  --bg-3:       #141a1d;
  --ink:        #ece4d3;   /* warm cream */
  --ink-dim:    #8a8c86;
  --ink-low:    #3a3f42;
  --line:       #1d2326;
  --line-2:     #2a3135;
  --accent:     #6f969d;   /* muted teal from portrait */
  --accent-hi:  #a8c5cb;
  --danger:     #c9896b;

  --f-display:  "Fraunces", "Times New Roman", Georgia, serif;
  --f-mono:     "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1240px;
  --pad:  clamp(1.5rem, 4vw, 4rem);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--f-mono);
  font-size: 14px;
  line-height: 1.6;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
}

::selection { background: var(--accent); color: var(--bg); }

/* -------------------------------------------------------------------------
   Fixed overlays: film grain + subtle scanline
   ------------------------------------------------------------------------- */

.grain {
  position: fixed; inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.scanline {
  position: fixed; inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0,0,0,0.22) 2px 3px
  );
}

/* -------------------------------------------------------------------------
   Ghosted scrolling quotes — left margin ambient ticker
   ------------------------------------------------------------------------- */

.ticker {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2.8rem;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  animation: ticker-appear 2000ms 3000ms ease forwards;
}

@keyframes ticker-appear {
  to { opacity: 1; }
}

.ticker__track {
  display: flex;
  flex-direction: column;
  animation: ticker-scroll 300s linear infinite;
}

.ticker__line {
  display: block;
  font-family: var(--f-mono);
  font-size: 0.55rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-dim);
  opacity: 0.45;
  white-space: nowrap;
  writing-mode: vertical-lr;
  text-orientation: mixed;
  padding: 1.8rem 0;
  transform: rotate(180deg);
}

@keyframes ticker-scroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

/* Fade top + bottom edges so quotes dissolve in and out */
.ticker::before,
.ticker::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 15vh;
  z-index: 1;
  pointer-events: none;
}
.ticker::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg), transparent);
}
.ticker::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg), transparent);
}

/* Hide ticker on narrow screens where there's no margin */
@media (max-width: 860px) {
  .ticker { display: none; }
}

/* -------------------------------------------------------------------------
   System status chip (top-right)
   ------------------------------------------------------------------------- */

.sys {
  position: fixed;
  top: clamp(1rem, 2vw, 1.75rem);
  right: clamp(1rem, 2vw, 1.75rem);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(10, 13, 15, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  animation: sys-appear 900ms 2200ms cubic-bezier(.2,.8,.2,1) forwards;
}
.sys__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-hi);
  box-shadow: 0 0 8px var(--accent);
  animation: sys-pulse 2.4s ease-in-out infinite;
}
.sys__sep { color: var(--ink-low); }
.sys__val { color: var(--accent-hi); }

@keyframes sys-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.75); }
}
@keyframes sys-appear {
  to { opacity: 1; }
}

/* -------------------------------------------------------------------------
   HERO
   ------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 75% center;
  filter: brightness(0.82) contrast(1.05) saturate(0.9);
  animation: hero-zoom 20000ms ease-out infinite alternate;
}
@keyframes hero-zoom {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

.hero__overlay {
  position: absolute; inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 80% 50%, transparent 0%, rgba(10,13,15,0.55) 60%, rgba(10,13,15,0.95) 100%),
    linear-gradient(to right, var(--bg) 0%, rgba(10,13,15,0.88) 25%, rgba(10,13,15,0.35) 55%, transparent 75%);
}

.hero__type {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--f-mono);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  padding: 0.4rem 0.8rem 0.4rem 0.65rem;
  border: 1px solid var(--line-2);
  background: rgba(10,13,15,0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateY(8px);
  animation: fade-up 900ms 200ms cubic-bezier(.2,.8,.2,1) forwards;
}
.eyebrow__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(111, 150, 157, 0.2);
  animation: sys-pulse 2.4s ease-in-out infinite;
}

.name {
  font-family: var(--f-display);
  font-size: clamp(3.75rem, 13vw, 11.5rem);
  font-weight: 300;
  line-height: 0.86;
  letter-spacing: -0.045em;
  margin: 0;
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
  color: var(--ink);
  text-shadow: 0 2px 40px rgba(0,0,0,0.6);
}
.name__line {
  display: block;
  transform: translateY(40px);
  animation: reveal-line 1200ms cubic-bezier(.2,.8,.1,1) forwards;
}
.name__line--1 {
  font-weight: 300;
  animation-delay: 450ms;
}
.name__line--2 {
  font-style: italic;
  font-weight: 350;
  padding-left: 1.25em;
  animation-delay: 700ms;
}
@keyframes reveal-line {
  to { transform: translateY(0); }
}

.tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 3.5rem 0 0;
  padding-left: 1.5em;
  font-family: var(--f-mono);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  text-transform: uppercase;
  opacity: 0;
  animation: fade-up 900ms 1100ms cubic-bezier(.2,.8,.2,1) forwards;
}
.tagline__prompt { color: var(--accent); font-weight: 500; }
.tagline__caret {
  display: inline-block;
  width: 7px; height: 1.1em;
  background: var(--accent);
  margin-left: 0.15rem;
  animation: blink 1.1s steps(2) infinite;
  vertical-align: text-bottom;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__marker {
  position: absolute;
  bottom: clamp(1.75rem, 4vw, 3rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex; flex-direction: column; align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: var(--accent);
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.32em;
  opacity: 0;
  animation: fade-up 1200ms 1600ms cubic-bezier(.2,.8,.2,1) forwards;
}
.hero__marker .marker__line {
  display: block;
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, transparent, var(--accent));
  transform-origin: top;
  animation: marker-tick 2.4s ease-in-out infinite;
}
@keyframes marker-tick {
  0%, 100% { transform: scaleY(0.35); }
  50%      { transform: scaleY(1); }
}

@keyframes fade-up {
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------
   Skip-to-content link (a11y)
   ------------------------------------------------------------------------- */

.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 99999;
  padding: 0.6rem 1.2rem;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent-hi);
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top 150ms;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   About (unnumbered interstitial)
   ------------------------------------------------------------------------- */

.about {
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.about__text {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 300;
  font-variation-settings: "opsz" 48, "SOFT" 50;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
  max-width: 42ch;
  border-left: 2px solid var(--line-2);
  padding-left: 1.5rem;
}
.about__text a {
  color: var(--accent-hi);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-low);
  transition: border-color 300ms;
}
.about__text a:hover {
  border-color: var(--accent-hi);
}

/* -------------------------------------------------------------------------
   Sections (Projects + Blog Access)
   ------------------------------------------------------------------------- */

.section {
  position: relative;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(5rem, 10vw, 9rem) var(--pad) clamp(3rem, 6vw, 5rem);
  z-index: 2;
}

.section-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 1.75rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
.section-num {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--accent);
}
.section-title {
  font-family: var(--f-display);
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink);
}
.section-title em { font-style: italic; font-weight: 250; }
.section-cmd {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.section-cmd .cmd-prompt { color: var(--accent); padding: 0 0.2em; }
.section-cmd .lock {
  color: var(--accent-hi);
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--line-2);
  margin-left: 0.3rem;
}

/* -------------------------------------------------------------------------
   Projects — terminal rows with ghosted monograms
   ------------------------------------------------------------------------- */

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

.project {
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  animation: fade-up 800ms cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: calc(120ms * var(--i, 1));
}

.project__ghost {
  position: absolute;
  right: clamp(0rem, 2vw, 1.5rem);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 200;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-size: clamp(5.5rem, 15vw, 14rem);
  line-height: 0.8;
  letter-spacing: -0.07em;
  color: var(--ink);
  opacity: 0.035;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  transition: opacity 600ms cubic-bezier(.2,.8,.2,1),
              transform 600ms cubic-bezier(.2,.8,.2,1);
}

.project__row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto auto 1fr auto auto auto;
  align-items: baseline;
  gap: 1.1rem;
  padding: 1.65rem 0;
  font-family: var(--f-mono);
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--ink);
  transition: padding 500ms cubic-bezier(.2,.8,.2,1);
}
.project__idx  { color: var(--accent); font-weight: 500; }
.project__slug { color: var(--ink); font-weight: 500; letter-spacing: 0.01em; }
.project__rule {
  display: block;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--line-2) 0 4px,
    transparent 4px 8px
  );
  transform: translateY(-0.2em);
  opacity: 0.7;
  transition: opacity 400ms, background 400ms;
}
.project__desc {
  color: var(--ink-dim);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.project__arrow {
  color: var(--accent);
  font-size: 1.1rem;
  transition: transform 450ms cubic-bezier(.2,.8,.2,1),
              color 450ms;
  display: inline-block;
}

/* Status chip ------------------------------------------------------------ */
.project__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem 0.25rem 0.55rem;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  color: var(--status-color, var(--ink-dim));
  background: rgba(255,255,255,0.015);
  min-width: 4.9rem;
  justify-content: center;
  transition: border-color 450ms, background 450ms;
}
.status__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--status-color, var(--ink-dim));
  box-shadow: 0 0 0 0 var(--status-color, var(--ink-dim));
  flex-shrink: 0;
}

/* Variants — set the custom property, everything picks it up */
.project__status--live { --status-color: #7bd389; }
.project__status--mvp  { --status-color: var(--accent-hi); }
.project__status--wip  { --status-color: #e3a86b; }
.project__status--soon { --status-color: #4d5458; }

/* Pulse only on LIVE */
.project__status--live .status__dot {
  animation: status-pulse 2200ms ease-out infinite;
}
@keyframes status-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(123,211,137,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(123,211,137,0); }
  100% { box-shadow: 0 0 0 0 rgba(123,211,137,0); }
}

.project:hover .project__status {
  border-color: var(--status-color, var(--line-2));
  background: rgba(255,255,255,0.03);
}
@media (prefers-reduced-motion: reduce) {
  .project__status--live .status__dot { animation: none; }
}

.project:hover .project__row { padding: 2.2rem 0; }
.project:hover .project__ghost {
  opacity: 0.11;
  transform: translateY(-50%) translateX(-2.5rem);
}
.project:hover .project__arrow {
  transform: translateX(14px);
  color: var(--accent-hi);
}
.project:hover .project__rule {
  opacity: 1;
  background: repeating-linear-gradient(
    to right,
    var(--accent) 0 4px,
    transparent 4px 8px
  );
}
.project:hover .project__slug { color: var(--accent-hi); }

/* -------------------------------------------------------------------------
   Blog access
   ------------------------------------------------------------------------- */

.blog-grid {
  display: block;
  margin-top: 2.5rem;
  width: 100%;
}

.blog-grid .blog-note { margin-bottom: 2.25rem; }

.blog-note {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 300;
  font-variation-settings: "opsz" 48, "SOFT" 50;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
}

.blog-actions {
  display: flex;
  flex-direction: row;
  gap: 0.85rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.btn {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.15rem 1.4rem;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line-2);
  background: transparent;
  overflow: hidden;
  isolation: isolate;
  transition: color 400ms, border-color 400ms;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-101%);
  transition: transform 500ms cubic-bezier(.6,0,.2,1);
  z-index: -1;
}
.btn:hover::before { transform: translateX(0); }
.btn:hover { color: var(--bg); border-color: var(--accent); }
.btn:hover .btn__arrow { transform: translateX(6px); }
.btn__arrow {
  font-size: 0.95rem;
  transition: transform 400ms cubic-bezier(.2,.8,.2,1);
}

.btn--primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn--primary::before { background: var(--accent-hi); }
.btn--primary:hover { color: var(--bg); border-color: var(--accent-hi); }

/* -------------------------------------------------------------------------
   Contact
   ------------------------------------------------------------------------- */

.contact-block {
  display: block;
  margin-top: 2.5rem;
  width: 100%;
}

.contact-block .contact-note { margin-bottom: 2.25rem; }

.contact-note {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 300;
  font-variation-settings: "opsz" 48, "SOFT" 50;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
}

.contact-btn {
  cursor: pointer;
  font-family: var(--f-mono);
  min-width: 18rem;
  justify-content: space-between;
}
.contact-btn.is-revealed {
  text-transform: none;
  letter-spacing: 0.04em;
}
.contact-btn.is-revealed .btn__label {
  font-size: 0.82rem;
}

/* -------------------------------------------------------------------------
   Now
   ------------------------------------------------------------------------- */

.now-block {
  margin-top: 2.5rem;
}

.now-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.now-list li {
  position: relative;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 300;
  font-variation-settings: "opsz" 36, "SOFT" 50;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1.55;
  color: var(--ink);
  padding: 0.9rem 0 0.9rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.now-list li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--f-mono);
  font-style: normal;
  font-weight: 500;
}
.now-list li strong {
  color: var(--accent-hi);
  font-weight: 400;
}
.now-list li a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-low);
  padding-bottom: 1px;
  transition: border-color 0.2s;
}
.now-list li a:hover {
  border-color: var(--accent);
}

.now-credit {
  margin-top: 1.5rem;
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-low);
}
.now-credit a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 300ms, border-color 300ms;
}
.now-credit a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* -------------------------------------------------------------------------
   Elsewhere — promoted social links
   ------------------------------------------------------------------------- */

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

.elsewhere__item {
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(12px);
  animation: fade-up 800ms cubic-bezier(.2,.8,.2,1) forwards;
  animation-delay: calc(100ms * var(--i, 1));
}

.elsewhere__row {
  display: grid;
  grid-template-columns: 2rem auto 1fr auto auto;
  align-items: center;
  gap: 1.1rem;
  padding: 1.25rem 0;
  font-family: var(--f-mono);
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--ink);
  transition: padding 500ms cubic-bezier(.2,.8,.2,1);
}

.elsewhere__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  color: var(--accent);
  transition: color 350ms, transform 350ms;
}
.elsewhere__icon svg { width: 24px; height: 24px; flex-shrink: 0; }

.elsewhere__name {
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 400ms;
}

.elsewhere__rule {
  display: block;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--line-2) 0 4px,
    transparent 4px 8px
  );
  transform: translateY(-0.1em);
  opacity: 0.7;
  transition: opacity 400ms, background 400ms;
}

.elsewhere__desc {
  color: var(--ink-dim);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.elsewhere__arrow {
  color: var(--accent);
  font-size: 1.1rem;
  transition: transform 450ms cubic-bezier(.2,.8,.2,1), color 450ms;
  display: inline-block;
}

.elsewhere__item:hover .elsewhere__row { padding: 1.6rem 0; }
.elsewhere__item:hover .elsewhere__icon { color: var(--accent-hi); transform: translateY(-2px); }
.elsewhere__item:hover .elsewhere__name { color: var(--accent-hi); }
.elsewhere__item:hover .elsewhere__rule {
  opacity: 1;
  background: repeating-linear-gradient(
    to right,
    var(--accent) 0 4px,
    transparent 4px 8px
  );
}
.elsewhere__item:hover .elsewhere__arrow {
  transform: translateX(10px);
  color: var(--accent-hi);
}

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

.foot {
  position: relative;
  max-width: var(--wrap);
  margin: clamp(4rem, 8vw, 7rem) auto 0;
  padding: 2rem var(--pad) 3rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  z-index: 2;
}

.foot__col { display: flex; align-items: center; gap: 1.25rem; }
.foot__col--right { justify-content: flex-end; gap: 1.5rem; }

.foot__label {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  color: var(--ink-low);
  text-transform: uppercase;
}

.socials {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: 1.1rem;
}
.socials a {
  display: inline-flex;
  width: 20px; height: 20px;
  color: var(--ink-dim);
  transition: color 350ms, transform 350ms;
}
.socials a:hover {
  color: var(--accent-hi);
  transform: translateY(-3px);
}
.socials svg { width: 100%; height: 100%; }

.foot__meta {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  color: var(--ink-low);
  text-transform: uppercase;
}
.foot__term {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}
.foot__caret {
  display: inline-block;
  width: 7px; height: 0.9em;
  background: var(--accent);
  animation: blink 1.1s steps(2) infinite;
}

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

@media (max-width: 860px) {
  body { font-size: 13px; }

  .hero__bg img { object-position: 70% center; }
  .hero__overlay {
    background:
      linear-gradient(to bottom, rgba(10,13,15,0.75) 0%, rgba(10,13,15,0.55) 40%, rgba(10,13,15,0.95) 100%);
  }

  .name__line--2 { padding-left: 0.6em; }

  .section-header {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    row-gap: 0.5rem;
  }
  .section-cmd { grid-column: 1 / -1; }

  .project__row {
    grid-template-columns: auto 1fr auto auto;
    gap: 0.6rem;
    font-size: 0.85rem;
  }
  .project__rule, .project__desc { display: none; }
  .project__status {
    font-size: 0.58rem;
    min-width: 0;
    padding: 0.18rem 0.45rem;
    letter-spacing: 0.12em;
  }
  .project__ghost { font-size: 7rem; opacity: 0.05; }

  .elsewhere__row {
    grid-template-columns: 2rem 1fr auto;
    gap: 0.6rem;
    font-size: 0.85rem;
  }
  .elsewhere__rule, .elsewhere__desc { display: none; }

  .blog-actions { flex-direction: column; }
  .contact-btn { min-width: 0; width: 100%; }

  .foot {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .foot__col { justify-content: center; flex-wrap: wrap; }
  .foot__col--right { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero__bg img { animation: none; }
}

/* -------------------------------------------------------------------------
   Konami code — matrix rain overlay
   ------------------------------------------------------------------------- */

.matrix-rain {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.92);
  pointer-events: none;
  overflow: hidden;
  animation: matrix-fadein 600ms ease forwards;
  transition: opacity 1.5s ease;
}

@keyframes matrix-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.matrix-col {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 16px;
  line-height: 1.15;
  color: #44ff77;
  text-shadow: 0 0 12px rgba(68, 255, 119, 0.8), 0 0 30px rgba(68, 255, 119, 0.3);
  animation: matrix-fall linear forwards;
}

.matrix-col span {
  display: block;
}

/* Lead character glows brightest */
.matrix-col span:last-child {
  color: #ccffdd;
  text-shadow: 0 0 16px rgba(200, 255, 220, 0.9);
}

@keyframes matrix-fall {
  0%   { transform: translateY(-30vh); }
  100% { transform: translateY(110vh); }
}

/* -------------------------------------------------------------------------
   Footer terminal trigger — make the caret clickable
   ------------------------------------------------------------------------- */

.foot__term--trigger {
  cursor: pointer;
  transition: color 300ms;
}
.foot__term--trigger:hover {
  color: var(--accent-hi);
}
.foot__term--trigger:hover .foot__caret {
  background: var(--accent-hi);
}

/* -------------------------------------------------------------------------
   Mini terminal easter egg
   ------------------------------------------------------------------------- */

.mini-term {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: min(520px, calc(100vw - 2rem));
  max-height: min(420px, 60vh);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: rgba(10, 13, 15, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 24px 80px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.04) inset;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--ink);
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 350ms cubic-bezier(.2,.8,.2,1),
              transform 350ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.mini-term.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mini-term__chrome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.mini-term__dots {
  display: flex;
  gap: 5px;
}
.mini-term__dots i {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink-low);
  display: block;
}
.mini-term__dots i:nth-child(1) { background: #e55; }
.mini-term__dots i:nth-child(2) { background: #eb4; }
.mini-term__dots i:nth-child(3) { background: #5b5; }

.mini-term__title {
  flex: 1;
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
}

.mini-term__close {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  transition: color 200ms;
}
.mini-term__close:hover { color: var(--ink); }

.mini-term__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.85rem;
  min-height: 80px;
  max-height: 280px;
}

.mini-term__line {
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 0.15rem;
}
.mini-term__line--echo {
  color: var(--ink-dim);
}
.mini-term__line--output {
  color: var(--ink);
}
.mini-term__line--error {
  color: var(--danger);
}
.mini-term__line--system {
  color: var(--ink-dim);
  font-style: italic;
}
.mini-term__hl {
  color: var(--accent-hi);
}

.mini-term__input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.mini-term__prompt {
  color: var(--accent);
  font-weight: 500;
  flex-shrink: 0;
}
.mini-term__input input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 0.75rem;
  caret-color: var(--accent);
}
.mini-term__input input::placeholder {
  color: var(--ink-low);
}

/* Scrollbar styling for terminal body */
.mini-term__body::-webkit-scrollbar { width: 4px; }
.mini-term__body::-webkit-scrollbar-track { background: transparent; }
.mini-term__body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 2px; }

/* =========================================================================
   BLOG PAGES — reuse tokens, keep the reading experience quiet
   ========================================================================= */

body.blog-post,
body.blog-index {
  background: var(--bg);
  color: var(--ink);
}

body.blog-post .grain,
body.blog-index .grain { opacity: 0.05; }
body.blog-post .scanline,
body.blog-index .scanline { display: none; }

.site-header {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2rem var(--pad) 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.site-header .site-title {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-transform: none;
}
.site-header nav a {
  color: var(--accent);
  text-decoration: none;
}
.site-header nav a:hover { color: var(--accent-hi); }

main.post {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2.5rem var(--pad) 4rem;
}

/* Individual post pages keep a comfortable reading measure */
body.blog-post main.post {
  max-width: 760px;
}

main.post h1 {
  font-family: var(--f-display);
  font-weight: 350;
  font-style: italic;
  font-variation-settings: "opsz" 96, "SOFT" 50;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
  margin: 0 0 0.75rem;
  color: var(--ink);
  letter-spacing: -0.025em;
}

main.post .meta {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 2.5rem;
}

figure.featured {
  margin: 0 0 2rem;
  border: 1px solid var(--line);
  overflow: hidden;
}
figure.featured img { width: 100%; height: auto; display: block; }

.post-body {
  font-family: var(--f-display);
  font-size: 1.075rem;
  line-height: 1.7;
  color: var(--ink);
  font-weight: 350;
  font-variation-settings: "opsz" 24, "SOFT" 50;
}
.post-body p { margin: 0 0 1.25rem; }
.post-body img { max-width: 100%; height: auto; display: block; }
.post-body figure { margin: 2rem 0; }
.post-body iframe {
  max-width: 100%;
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}
.post-body a {
  color: var(--accent-hi);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-tags {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.post-tags .tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  margin: 0 0.3rem 0.3rem 0;
  border: 1px solid var(--line-2);
  color: var(--ink-dim);
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}
.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
}
.post-list li time {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--accent);
}
.post-list li a {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  transition: color 300ms;
}
.post-list li a:hover { color: var(--accent-hi); }

.site-footer {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 2rem var(--pad) 3rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-low);
}
