/* ============================================================
   0xn4utilus — infosec & development blog
   minimal, playful, elegant · dark
   ============================================================ */

:root {
  --bg: #12141b;
  --surface: #1b1e28;
  --text: #ece9e0;
  --muted: #9c9688;
  --line: #2a2d38;
  --coral: #ff6a4a;
  --peach: #ffc2a6;

  --display: "Fraunces", Georgia, serif;
  --body: "Karla", "Helvetica Neue", Arial, sans-serif;
  --mono: "Space Mono", "SFMono-Regular", Consolas, monospace;

  --max: 760px;
  --pad: clamp(1.25rem, 4vw, 2rem);
  --section-pad: clamp(3.5rem, 9vw, 7rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--coral);
  color: #12141b;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a:focus-visible,
button:focus-visible,
.skip-link:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  padding: 0.6rem 1rem;
  background: var(--text);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.8rem;
  z-index: 50;
  transition: top 0.2s ease;
}
.skip-link:focus-visible {
  top: 1rem;
}

/* ============================================================
   NAV
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.9rem var(--pad);
  max-width: var(--max);
  margin: 0 auto;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
}

.nav__name {
  font-family: var(--mono);
  font-size: 0.85rem;
}

.nav__links {
  display: flex;
  gap: 1.4rem;
  align-items: center;
}

.nav__links a,
.nav__rss {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  position: relative;
  transition: color 0.2s ease;
}
.nav__links a::after,
.nav__rss::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1.5px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav__links a:hover,
.nav__rss:hover {
  color: var(--text);
}
.nav__links a:hover::after,
.nav__rss:hover::after {
  transform: scaleX(1);
}

.nav__rss {
  color: var(--coral);
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) var(--pad) var(--section-pad);
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.35em;
  background: var(--coral);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink {
  to { visibility: hidden; }
}

.hero__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.lede {
  margin: 1.2rem 0 0;
  max-width: 34rem;
  font-size: clamp(1rem, 2vw, 1.12rem);
  color: var(--muted);
}
.lede__aside {
  font-family: var(--mono);
  font-size: 0.8em;
  opacity: 0.6;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.3rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover {
  background: var(--coral);
  color: #12141b;
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn--ghost:hover {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--coral);
  color: var(--coral);
}

/* ============================================================
   SECTIONS
   ============================================================ */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) var(--section-pad);
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
  margin-bottom: 1.6rem;
}

.section__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.section__sub {
  margin: 0.35rem 0 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.section__meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---- filter chips ---- */

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}

.filter {
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.filter:hover {
  color: var(--text);
  border-color: var(--muted);
}
.filter.is-active {
  color: var(--bg);
  background: var(--coral);
  border-color: var(--coral);
}

/* ---- post list ---- */

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

.post {
  border-bottom: 1px solid var(--line);
}
.post:first-child {
  border-top: 1px solid var(--line);
}

.post__link {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "meta arrow"
    "title arrow"
    "excerpt arrow"
    "tags arrow";
  gap: 0.35rem 1rem;
  padding: 1.5rem 0.4rem;
  transition: background 0.25s ease, padding 0.25s ease;
}

.post__meta {
  grid-area: meta;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.post__path {
  color: var(--coral);
}

.post__time {
  color: var(--muted);
  opacity: 0.75;
}

.post__title {
  grid-area: title;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  transition: transform 0.25s ease, color 0.2s ease;
}

.post__excerpt {
  grid-area: excerpt;
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 42rem;
}

.post__tags {
  grid-area: tags;
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.post__tags span {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.post__arrow {
  grid-area: arrow;
  align-self: center;
  font-size: 1.3rem;
  color: var(--coral);
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.post__link:hover {
  background: color-mix(in srgb, var(--coral) 6%, transparent);
  padding-left: 1rem;
  padding-right: 1rem;
}
.post__link:hover .post__title {
  color: var(--coral);
  transform: translateX(0.3rem);
}
.post__link:hover .post__arrow {
  opacity: 1;
  transform: translate(0, 0);
}

.post.is-hidden {
  display: none;
}

/* ============================================================
   POST PAGE & PAGE (article bodies)
   ============================================================ */

.post-page,
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) var(--pad) var(--section-pad);
}

.post-page__back {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.6rem;
  transition: color 0.2s ease;
}
.post-page__back:hover {
  color: var(--coral);
}

.post-page__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.post-page__meta {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.post-page__path {
  color: var(--coral);
}

.post-page__time {
  opacity: 0.75;
}

.post-page__tags {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.post-page__tags li {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.post-page__foot {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* 404 */
.page--center {
  text-align: center;
}
.page__code {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(4rem, 14vw, 8rem);
  line-height: 1;
  color: var(--coral);
}
.page__lede {
  margin: 1rem 0 2rem;
  color: var(--muted);
}

/* ============================================================
   PROSE (markdown-rendered content)
   ============================================================ */

.prose {
  margin-top: 2rem;
  font-size: 1.05rem;
}
.prose > :first-child {
  margin-top: 0;
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
}
.prose h2 {
  font-size: 1.7rem;
  margin: 2.4rem 0 0.8rem;
}
.prose h3 {
  font-size: 1.3rem;
  margin: 1.8rem 0 0.6rem;
}
.prose h4 {
  font-size: 1.05rem;
  margin: 1.4rem 0 0.5rem;
}

.prose p {
  margin: 0 0 1.1rem;
  color: #d6d2c7;
}

.prose a {
  color: var(--coral);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--coral) 45%, transparent);
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}
.prose a:hover {
  text-decoration-color: var(--coral);
}

.prose strong {
  color: var(--text);
}

.prose ul,
.prose ol {
  margin: 0 0 1.1rem;
  padding-left: 1.4rem;
}
.prose li {
  margin: 0.3rem 0;
  color: #d6d2c7;
}

.prose blockquote {
  margin: 1.4rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 2px solid var(--coral);
  color: var(--muted);
}
.prose blockquote p {
  color: var(--muted);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--peach);
  background: var(--surface);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}

.prose pre,
.prose .highlight {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1.4rem 0;
  font-size: 0.86rem;
  line-height: 1.6;
}
.prose pre code {
  background: none;
  padding: 0;
  color: #e6e2d8;
  border-radius: 0;
}

.prose img {
  border-radius: 8px;
  margin: 1.4rem auto;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.4rem 0;
  font-size: 0.9rem;
}
.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.7rem;
  text-align: left;
}
.prose th {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text);
  background: var(--surface);
}

/* ---- rouge syntax highlighting (dark) ---- */

.highlight {
  color: #e6e2d8;
}
.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cs,
.highlight .cp {
  color: #6f6a5f;
  font-style: italic;
}
.highlight .k,
.highlight .kd,
.highlight .kn,
.highlight .kr,
.highlight .kt,
.highlight .kc,
.highlight .kp {
  color: #ff8a6b;
}
.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sc,
.highlight .sd,
.highlight .se,
.highlight .sh,
.highlight .si,
.highlight .sx,
.highlight .sr,
.highlight .ss {
  color: #b5d0a8;
}
.highlight .m,
.highlight .mi,
.highlight .mf,
.highlight .mh,
.highlight .mo,
.highlight .il {
  color: #ffc2a6;
}
.highlight .nf,
.highlight .nc,
.highlight .nd,
.highlight .nn,
.highlight .na {
  color: #f0d9a8;
}
.highlight .nb,
.highlight .bp {
  color: #ff8a6b;
}
.highlight .o,
.highlight .p {
  color: #9c9688;
}
.highlight .nv,
.highlight .vc,
.highlight .vg,
.highlight .vi {
  color: #e6e2d8;
}
.highlight .err {
  color: #ff6a4a;
}

/* ============================================================
   ABOUT — "now" page
   ============================================================ */

.page__content {
  margin-top: 0.5rem;
}

.about__bio {
  margin: 0 0 1.8rem;
  max-width: 36rem;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--muted);
}

.now__line {
  margin: 0;
  font-family: var(--body);
  font-size: 1.12rem;
  color: var(--text);
  line-height: 1.5;
}
.now__line a {
  color: var(--coral);
  border-bottom: 1px solid color-mix(in srgb, var(--coral) 40%, transparent);
  transition: border-color 0.2s ease;
}
.now__line a:hover {
  border-color: var(--coral);
}
.now__line--muted {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.interests,
.playing {
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.interests__label,
.playing__label {
  margin: 0 0 0.8rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: lowercase;
}

.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tags li {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--peach);
  padding: 0.32rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--coral) 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--coral) 6%, transparent);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.tags li:hover {
  border-color: var(--coral);
  color: var(--coral);
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.8rem var(--pad) 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}
.footer__links a {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  transition: color 0.2s ease;
}
.footer__links a:hover {
  color: var(--coral);
}

.footer__note {
  margin: 0 0 0 auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.7;
}

/* ============================================================
   HERO ENTRANCE (played once on load)
   ============================================================ */

.hero .eyebrow,
.hero .hero__name,
.hero .lede,
.hero .cta-row {
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero .eyebrow { animation-delay: 0.1s; }
.hero .hero__name { animation-delay: 0.18s; }
.hero .lede { animation-delay: 0.26s; }
.hero .cta-row { animation-delay: 0.34s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* post page — subtle fade-in on open */
.post-page {
  animation: fade-in 0.3s ease both;
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 400px) {
  .nav {
    gap: 1rem;
  }
  .nav__links {
    gap: 1rem;
  }
  .nav__rss {
    display: none;
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .cursor,
  .hero .eyebrow,
  .hero .hero__name,
  .hero .lede,
  .hero .cta-row,
  .post-page {
    animation: none;
  }
  .post__link,
  .post__link:hover,
  .btn,
  .btn:hover {
    transition: none;
  }
}
