/* ==========================================================================
   Isaac Osabofu - custom design layer
   Loaded last, after site.css / syntax.css / prism.css, so it is the single
   source of truth for the visual system.

   Design language: quiet, refined, dark.
   One warm off-black canvas, one warm off-white text, a single restrained
   amber accent, hairlines instead of shadows, sentence-case type.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  --bg:            #111110;   /* warm near-black canvas          */
  --bg-elevated:   #171716;   /* sticky header / raised surfaces */
  --surface:       #1a1a19;   /* cards, code blocks              */
  --surface-2:     #212120;   /* hover surface                   */
  --line:          rgba(255, 255, 255, 0.08);  /* hairlines      */
  --line-strong:   rgba(255, 255, 255, 0.14);

  --text:          #f2f1ec;   /* warm off-white                  */
  --text-muted:    #a3a29c;   /* secondary                       */
  --text-faint:    #8b8a84;   /* tertiary / metadata             */

  --accent:        #d9a15c;   /* warm amber                      */
  --accent-soft:   #e7b87b;
  --accent-dim:    rgba(217, 161, 92, 0.14);

  --radius:        8px;
  --radius-lg:     12px;

  --container:     1000px;
  --measure:       720px;     /* comfortable reading line length */

  --font-sans:     "Space Grotesk", ui-sans-serif, system-ui, -apple-system,
                   "Segoe UI", sans-serif;
  --font-mono:     "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas,
                   monospace;

  --ease:          cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#wrapper {
  flex: 1 0 auto;
  width: 100%;
  margin-bottom: 0;   /* override ghostwriter sticky-footer negative margin */
}
#wrapper::after { display: none; }

::selection {
  background: var(--accent);
  color: #14130f;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: #2c2c2a;
  border-radius: 6px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #3a3a37; }

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.75em;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text);
  text-transform: none;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; color: var(--text-muted); }

p { margin: 0 0 1.4em; }

a {
  color: var(--accent);
  text-decoration: none;
  background-color: transparent;   /* kill blanket #141414 bg from site.css */
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
a:hover { color: var(--accent-soft); }

strong { font-weight: 600; }

small { font-size: 0.8125rem; color: var(--text-muted); }

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 3rem 0;
}

blockquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 2px solid var(--accent);
  color: var(--text-muted);
}
blockquote p { margin: 0; }

ul, ol {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
  line-height: 1.7;
}
li { margin-bottom: 0.4em; }
li:last-child { margin-bottom: 0; }

/* Inline + block code */
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.15em 0.4em;
  color: #e8d9bd;
}

pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 0 0 1.6em;
  overflow-x: auto;
  line-height: 1.6;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 0.85rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.6em;
  font-size: 0.9rem;
}
th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line-strong);
}
td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
}
tbody tr:last-child td { border-bottom: none; }

/* Images + figures */
img { max-width: 100%; height: auto; }

figure { margin: 0 0 1.8em; }

figcaption {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
}

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

.post-text,
.table-of-contents {
  max-width: var(--measure);
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   5. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(17, 17, 16, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

.site-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.site-logo:hover { color: var(--accent-soft); }

.site-nav-bar-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav-item {
  background: none;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.site-nav-item a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
}
.site-nav-item a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.site-nav-cta a {
  display: inline-block;
  margin-left: 8px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #14130f;
  background: var(--accent);
  border-radius: 6px;
  transition: background 0.2s var(--ease), transform 0.1s var(--ease);
}
.site-nav-cta a:hover {
  background: var(--accent-soft);
  color: #14130f;
}
.site-nav-cta a:active { transform: translateY(1px); }

/* Hamburger (mobile) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

/* --------------------------------------------------------------------------
   6. Home hero
   -------------------------------------------------------------------------- */
.hero {
  padding: clamp(4rem, 12vh, 8rem) 0 clamp(3rem, 8vh, 5rem);
}

.h1-home {
  font-size: clamp(2.75rem, 8vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0 0 0.5rem;
}

.h2-home {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-muted);
  max-width: 28ch;
  margin: 0 0 1.25rem;
}

.hero-lede {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 0 2.25rem;
}

.cta-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.cta-text:hover {
  color: var(--accent-soft);
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   7. Sections (home)
   -------------------------------------------------------------------------- */
.section {
  padding: clamp(2rem, 4vh, 5.5rem) 0;
}

.section-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.home-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.home-nav-section {
  display: block;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.home-nav-section:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}
.home-nav-section:hover .h3-home { color: var(--accent-soft); }

.h3-home {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.home-nav-section p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   8. Post / page headers
   -------------------------------------------------------------------------- */
.post-header {
  padding: clamp(3rem, 8vh, 5rem) 0 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

.blog-header {
  max-width: var(--measure);
  margin: 0 auto;
  text-align: left;
}

.post-title,
.page-title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 0 0.6rem;
  text-align: left;
  text-transform: none;
}

.post-description {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0;
}

.post-date,
.post-reading,
.blog-description {
  color: var(--text-faint);
  font-size: 0.85rem;
  margin: 1rem 0 0;
  line-height: 1.6;
}
.post-date a,
.post-reading a,
.blog-description a { color: var(--text-muted); }
.post-date a:hover,
.post-reading a:hover,
.blog-description a:hover { color: var(--accent); }

.post-line { position: relative; }
.post-line::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  background: var(--line-strong);
  margin-top: 1.25rem;
}

/* --------------------------------------------------------------------------
   9. Table of contents
   -------------------------------------------------------------------------- */
.table-of-contents {
  font-size: 0.9rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}
.table-of-contents a { color: var(--text-muted); }
.table-of-contents a:hover { color: var(--accent); }
.table-of-contents ul { margin: 0; padding-left: 1.2rem; }
.table-of-contents > nav > ul { padding-left: 0; list-style: none; }

/* --------------------------------------------------------------------------
   10. Post content + code blocks
   -------------------------------------------------------------------------- */
.post-content {
  font-size: 1.05rem;
  line-height: 1.75;
}
.post-content h2, .post-content h3, .post-content h4 {
  margin-top: 2.25rem;
}
.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(217, 161, 92, 0.4);
}
.post-content a:hover { text-decoration-color: var(--accent); border-bottom: none; }

.post-featured-image,
.blog-image {
  border-radius: var(--radius);
  margin: 0 0 1.8em;
}

.post-code { margin-bottom: 1.6em; }

.code-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0.4rem 0.6rem;
  position: relative;
}
.post-code .code-header + pre,
.post-code .code-header + .chroma,
.post-code pre {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: -1px;
}

.copy-code-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 5px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  width: auto;
}
.copy-code-button:hover { background: var(--surface); color: var(--text); }
.copy-code-button img { margin: 0; }

.copy-feedback {
  position: absolute;
  right: 12px;
  top: -26px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.copy-feedback.show { opacity: 1; }

/* --------------------------------------------------------------------------
   11. Post list (index / blog / tools / tags)
   -------------------------------------------------------------------------- */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-stub {
  border-bottom: 1px solid var(--line-strong);
}
.post-stub:last-child { border-bottom: none; }

.post-stub a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 1.4rem 0.5rem;
  color: var(--text);
  background: none;
  transition: padding-left 0.2s var(--ease), color 0.2s var(--ease);
}
.post-stub a:hover {
  color: var(--text);
  background: none;
  padding-left: 1rem;
}

.post-stub-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
  transition: color 0.2s var(--ease);
}
.post-stub a:hover .post-stub-title { color: var(--accent-soft); }

.post-stub-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post-stub-date {
  font-size: 0.8rem;
  color: var(--text-faint);
}

.post-stub-tag {
  align-self: flex-start;
  background: var(--accent-dim);
  color: var(--accent-soft);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 9px;
  border-radius: 999px;
}

/* --------------------------------------------------------------------------
   12. Post footer (tags + share)
   -------------------------------------------------------------------------- */
.post-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.post-tags {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.post-tags span { color: var(--text-faint); }
.post-tags a { color: var(--text-muted); margin-left: 4px; }
.post-tags a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   13. Pagination
   -------------------------------------------------------------------------- */
.post-navigation {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 3rem 0;
}

.newer-posts,
.older-posts {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.newer-posts:hover,
.older-posts:hover {
  border-color: var(--accent);
  color: var(--accent-soft);
}

.page-number { display: none; }

/* --------------------------------------------------------------------------
   14. Forms
   -------------------------------------------------------------------------- */
.contact-form-container,
.newsletter-form-container {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 0 0.4rem;
}

input,
textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid #4a4a46;
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
  margin-bottom: 1.1rem;
  transition: border-color 0.2s var(--ease);
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}
input::placeholder,
textarea::placeholder { color: var(--text-faint); }

textarea { resize: vertical; min-height: 8rem; }

button {
  background: var(--accent);
  color: #14130f;
  border: none;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  width: auto;
  transition: background 0.2s var(--ease), transform 0.1s var(--ease);
}
button:hover { background: var(--accent-soft); }
button:active { transform: translateY(1px); }

/* --------------------------------------------------------------------------
   15. Footer
   -------------------------------------------------------------------------- */
footer {
  flex-shrink: 0;
  margin-top: 4rem;
  padding: 0;   /* kill leaked 200px top padding from site.css */
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
}

.footer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 3rem;
  padding: 3.5rem 0 2.5rem;
  max-width: var(--container);
  margin: 0 auto;
  background: none;
}

.footer-column { display: flex; flex-direction: column; }

.footer-column > p {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 1rem;
  text-transform: uppercase;
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-list li { margin-bottom: 0.6rem; }
.footer-list a {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-list a:hover { color: var(--accent-soft); }

.footer-copyright {
  border-top: 1px solid var(--line);
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  max-width: var(--container);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  background: none;        /* kill leaked #141414 box from site.css */
  text-transform: none;    /* kill leaked uppercase from site.css */
}
.footer-copyright a { color: var(--text-muted); font-weight: inherit; }
.footer-copyright a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   16. Misc / legacy surfaces kept for compatibility
   -------------------------------------------------------------------------- */
.rounded-container { border-radius: var(--radius-lg); }

.svg-container {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 1.5rem;
}
.svg-container p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.svg-container img { width: 32px; height: 32px; }

.logo-button { color: var(--text-muted); }
.logo-button:hover { color: var(--accent); }
.logo-button img { margin: 0; }

.error { text-align: center; color: var(--text-muted); }

.hidden { display: none !important; }
.clearfix::after { content: ""; display: table; clear: both; }

.no-mobile { display: block; }
.no-desktop { display: none; }

/* Chroma code blocks inherit the dark surface */
.chroma { background: var(--surface) !important; border-radius: var(--radius); }

/* Contact section (home) */
.contact-me-container {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.contact-copy p { max-width: 56ch; }

/* Social icons (home contact + footer) */
.social-icons {
  display: flex;
  gap: 1.75rem;
  margin-top: 1.5rem;
}
.logo-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.logo-button:hover { color: var(--accent-soft); }
.logo-button img { width: 26px; height: 26px; margin: 0; }

/* 404 */
.error-page {
  padding: clamp(4rem, 15vh, 8rem) 0;
  text-align: center;
}
.error-code {
  font-size: clamp(5rem, 22vw, 11rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 0 0 0.75rem;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   17. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  body { font-size: 16px; padding: 0; background: var(--bg); color: var(--text); }

  .container { padding: 0 20px; max-width: 100%; }

  .site-nav-bar-container {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 20px 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--line);
  }
  .site-title-wrapper.menu-open .site-nav-bar-container { display: flex; }

  .site-nav-item a {
    display: block;
    padding: 12px 8px;
    font-size: 1rem;
  }
  .site-nav-cta a {
    display: block;
    margin: 8px 0 0;
    text-align: center;
  }

  .hamburger { display: flex; }

  .no-mobile { display: none; }
  .no-desktop { display: block; }

  .hero { padding: 3rem 0 2.5rem; }

  .post-header { padding: 2.5rem 0 1.5rem; }
  .post-title, .page-title { font-size: 1.9rem; }

  .footer { grid-template-columns: 1fr; gap: 2rem; padding: 2.5rem 0 1.5rem; }

  .hide-on-mobile { display: none; }

  .contact-me-container { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* --------------------------------------------------------------------------
   18. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
