/* ==================================================================
   irosha.com — simple engineer's portfolio, light mode only
   IBM Plex Mono (body) · Fraunces (name) · warm paper palette
   ================================================================== */

:root {
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-serif: "Fraunces", Georgia, serif;

  --bg: #faf8f4;
  --text: #22201d;
  --muted: #6f6c65;
  --accent: #b35c1e;
  --line: #e5e0d7;
  --card: #ffffff;
  --tip-bg: #22201d;
  --tip-text: #faf8f4;
  --shadow: rgba(60, 45, 25, 0.16);
  --shadow-sm: rgba(60, 45, 25, 0.07);

  /* one easing curve and one duration for the whole site */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.22s;
}

/* ============ Base ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur) var(--ease),
              text-decoration-thickness var(--dur) var(--ease);
}
a:hover {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

em { font-style: italic; }
strong { font-weight: 600; }

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

/* ============ Skip link ============ */
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  background: var(--tip-bg);
  color: var(--tip-text);
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* ============ Top nav ============ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.monogram {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--accent);
  text-decoration: none;
  line-height: 1;
}

.topnav-links {
  display: flex;
  gap: 18px;
  font-size: 12px;
  letter-spacing: 0.06em;
  overflow-x: auto;
}
.topnav-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}
.topnav-links a:hover { color: var(--accent); }

/* anchor targets clear the sticky nav */
.section, #top { scroll-margin-top: 58px; }

/* ============ Header ============ */
/* A short, quiet stagger on the above-the-fold block. Nothing below the
   fold animates — it would finish before you ever scrolled to it. */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.header-top,
.site-header .name,
.site-header .intro p,
.site-header .socials {
  animation: rise 0.5s var(--ease) both;
}
.site-header .name          { animation-delay: 0.05s; }
.site-header .intro p:nth-of-type(1) { animation-delay: 0.10s; }
.site-header .intro p:nth-of-type(2) { animation-delay: 0.15s; }
.site-header .intro p:nth-of-type(3) { animation-delay: 0.20s; }
.site-header .socials       { animation-delay: 0.25s; }

.header-top { margin-bottom: 28px; }

.portrait-card {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px var(--shadow-sm), 0 12px 28px -12px var(--shadow);
}
.portrait-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(38px, 7vw, 52px);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.tagline {
  color: var(--muted);
  margin-bottom: 22px;
}


.socials {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.socials a { color: var(--muted); }
.socials a:hover { color: var(--accent); }
.sep { margin: 0 6px; color: var(--line); }

.site-header { margin-bottom: 24px; }


/* ============ Left rail (desktop) ============ */
.sidenav { display: none; }

@media (min-width: 1140px) {
  .topnav { display: none; }
  .sidenav {
    display: block;
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
  }
  .sidenav ul { list-style: none; }
  .sidenav li + li { margin-top: 4px; }
  .sidenav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s ease;
  }
  /* dash grows and colours in on the active section */
  .sidenav a::before {
    content: "";
    width: 14px;
    height: 1px;
    background: var(--line);
    transition: width 0.25s ease, background 0.25s ease;
  }
  .sidenav a:hover { color: var(--text); }
  .sidenav a:hover::before { width: 22px; background: var(--muted); }
  .sidenav a.active { color: var(--accent); }
  .sidenav a.active::before { width: 30px; background: var(--accent); }

  /* section anchors no longer sit under a sticky bar */
  .section, #top { scroll-margin-top: 24px; }
}

/* ============ Intro ============ */
.intro { margin-bottom: 22px; }
.intro p { margin-bottom: 14px; }
.intro p:last-child { margin-bottom: 0; }

/* ============ Tooltips ============ */
.tip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--accent);
  outline: none;
}
.tip:focus-visible { border-radius: 2px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }

.tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 300px;
  background: var(--tip-bg);
  color: var(--tip-text);
  font-size: 12px;
  line-height: 1.55;
  letter-spacing: 0;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 12px 30px var(--shadow);
  white-space: normal;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 60;
  pointer-events: none;
}
.tip::before {
  /* little arrow */
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--tip-bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease;
  z-index: 60;
  pointer-events: none;
}
.tip:hover::after, .tip:focus::after,
.tip:hover::before, .tip:focus::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.tip:hover::before, .tip:focus::before { transform: translateX(-50%); }

/* keep tooltips inside the viewport near the page edges */
.tip.edge-left::after { left: 0; transform: translateX(0) translateY(4px); }
.tip.edge-left:hover::after, .tip.edge-left:focus::after { transform: translateX(0) translateY(0); }
.tip.edge-right::after { left: auto; right: 0; transform: translateX(0) translateY(4px); }
.tip.edge-right:hover::after, .tip.edge-right:focus::after { transform: translateX(0) translateY(0); }

/* ============ Sections (always expanded) ============ */
.section {
  border-top: 1px solid var(--line);
  padding: 26px 4px 10px;
}

.section h2 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.14em;
  margin-bottom: 18px;
}
.h-link {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: color 0.2s ease;
}
.h-link:hover { color: var(--accent); }
.marker {
  color: var(--accent);
  font-weight: 400;
  display: inline-block;
  transition: transform var(--dur) var(--ease);
}
.h-link:hover .marker { transform: translateX(3px); }

.content > p { margin-bottom: 16px; }
.content > :last-child { margin-bottom: 20px; }

/* ============ Timeline ============ */
.timeline { list-style: none; position: relative; }

/* hairline rail running between the date column and the entry */
.timeline::before {
  content: "";
  position: absolute;
  left: 129px;
  top: 10px;
  bottom: 14px;
  width: 1px;
  background: var(--line);
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 14px 0 18px;
}
.timeline li:first-child { padding-top: 2px; }

/* dot sits on the rail, level with the date */
.timeline li::before {
  content: "";
  position: absolute;
  left: 126px;
  top: 20px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1.5px var(--line);
  transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.timeline li:first-child::before { top: 8px; }
.timeline li:hover::before {
  background: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
}

.when {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.06em;
  padding-top: 3px;
}

.what h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}
.where {
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ============ Episodes ============ */
.episodes {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 18px;
  margin: 4px 0 16px;
}

.ep-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.ep-grid a {
  display: block;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
}

.ep-thumb {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ep-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
/* soft scrim */
.ep-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 15, 10, 0.34), rgba(20, 15, 10, 0) 65%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
/* play badge */
.ep-thumb::before {
  content: "▶";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  padding-left: 2px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 12px rgba(20, 15, 10, 0.3);
  opacity: 0;
  transform: scale(0.82);
  transition: opacity var(--dur) var(--ease), transform 0.3s var(--ease);
}
.ep-thumb img { transition: transform 0.45s var(--ease); }

.ep-grid a:hover .ep-thumb {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 1px 2px var(--shadow-sm), 0 14px 26px -12px var(--shadow);
}
.ep-grid a:hover .ep-thumb img { transform: scale(1.045); }
.ep-grid a:hover .ep-thumb::after { opacity: 1; }
.ep-grid a:hover .ep-thumb::before { opacity: 1; transform: scale(1); }

.ep-grid .ep-title {
  display: block;
  font-size: 11.5px;
  line-height: 1.5;
  margin-top: 8px;
  color: var(--text);
}
.ep-grid a:hover .ep-title { color: var(--accent); }

.row-links { font-size: 14px; }

/* ============ Posts ============ */
.posts { list-style: none; }
.posts li { border-top: 1px dashed var(--line); }
.posts li:first-child { border-top: none; }

.post-row {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding: 14px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  text-decoration: none;
  transition: background var(--dur) var(--ease);
}
/* thin accent bar that grows from the middle out */
.post-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
  transition: height 0.28s var(--ease);
}
.post-row:hover { background: var(--card); }
.post-row:hover::before { height: calc(100% - 16px); }

.posts .date {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.post-title {
  display: block;
  font-weight: 500;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 3px;
}
.post-row:hover .post-title { text-decoration-color: var(--accent); }
.post-sub {
  display: block;
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 2px;
}
.posts .arrow {
  color: var(--muted);
  transition: transform 0.28s var(--ease), color var(--dur) var(--ease);
}
.post-row:hover .arrow { transform: translateX(4px); color: var(--accent); }

/* ============ Advisory ============ */
.advisory dt { font-weight: 600; margin-top: 16px; }
.advisory dt::before { content: "— "; color: var(--accent); }
.cta-line { margin-top: 22px; }

.advisory dd {
  color: var(--muted);
  font-size: 14px;
  margin-left: 22px;
}


/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 28px;
}

.quote {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 20px;
}
.quote cite { font-style: normal; white-space: nowrap; }

.footer-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.to-top {
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
}
.to-top:hover { color: var(--accent); }

.fine {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}


/* ============ Easter egg: simulated user ============ */
/* Hidden until the Konami code fires. Movement is driven by CSS
   transitions on timers, not rAF, so it runs anywhere. */
.sim-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition: transform 1s var(--ease), opacity 0.3s var(--ease);
}
.sim-cursor svg { display: block; filter: drop-shadow(0 2px 4px var(--shadow)); }
.sim-cursor .sim-label {
  position: absolute;
  left: 16px;
  top: 16px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--tip-text);
  background: var(--accent);
  padding: 3px 7px;
  border-radius: 4px;
}
.sim-cursor.on { opacity: 1; }

/* whatever the persona is "looking at" */
.sim-focus {
  outline: 1.5px dashed var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
  transition: outline-color 0.2s var(--ease);
}

.sim-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 201;
  max-width: min(440px, calc(100vw - 36px));
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  background: var(--tip-bg);
  color: var(--tip-text);
  font-size: 12.5px;
  line-height: 1.6;
  padding: 14px 16px;
  border-radius: 10px;
  box-shadow: 0 16px 40px var(--shadow);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.sim-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.sim-toast a { color: var(--accent); text-decoration-color: var(--accent); }
.sim-toast .sim-dismiss {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
  .sim-cursor { display: none; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============ Print ============ */
@media print {
  .topnav, .sidenav, .skip-link, .to-top { display: none !important; }
  body { background: #fff; }
  .tip { border-bottom: none; }
}

/* ============ Mobile ============ */
@media (max-width: 560px) {
  .wrap { padding: 28px 18px 60px; }
  .topnav { padding: 10px 18px; }
  .portrait-card { width: 104px; height: 104px; }
  /* single column here, so the rail/dots would cut through the text —
     fall back to hairline separators */
  .timeline::before,
  .timeline li::before { display: none; }
  .timeline li {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 16px 0;
    border-top: 1px dashed var(--line);
  }
  .timeline li:first-child { border-top: none; padding-top: 2px; }
  .ep-grid { grid-template-columns: repeat(2, 1fr); }
  .post-row { grid-template-columns: 1fr auto; }
  .posts .date { grid-column: 1 / -1; }
  .tip::after { max-width: 240px; }
}
