/* ------------------------------------------------------------------
   theme: nightfox (dark, default) / dayfox (light)
   palettes: https://github.com/EdenEast/nightfox.nvim
   design: type-driven with terminal accents
------------------------------------------------------------------- */

:root {
  /* nightfox */
  --bg0: #131a24;
  --bg1: #192330;
  --bg2: #212e3f;
  --bg3: #29394f;
  --fg0: #d6d6d7;
  --fg1: #cdcecf;
  --fg2: #aeafb0;
  --fg3: #71839b;
  --sel: #2b3b51;
  --comment: #738091;
  --red: #c94f6d;
  --green: #81b29a;
  --yellow: #dbc074;
  --blue: #719cd6;
  --magenta: #9d79d6;
  --cyan: #63cdcf;
  --orange: #f4a261;
  --pink: #d67ad2;
  color-scheme: dark;
}

:root[data-theme="light"] {
  /* dayfox */
  --bg0: #f6f2ee;
  --bg1: #f6f2ee;
  --bg2: #e4dcd4;
  --bg3: #d3c7bb;
  --fg0: #302b5d;
  --fg1: #3d2b5a;
  --fg2: #643f61;
  --fg3: #824d5b;
  --sel: #e7d2be;
  --comment: #837a72;
  --red: #a5222f;
  --green: #396847;
  --yellow: #ac5402;
  --blue: #2848a9;
  --magenta: #6e33ce;
  --cyan: #287980;
  --orange: #955f61;
  --pink: #a440b5;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg0: #f6f2ee;
    --bg1: #f6f2ee;
    --bg2: #e4dcd4;
    --bg3: #d3c7bb;
    --fg0: #302b5d;
    --fg1: #3d2b5a;
    --fg2: #643f61;
    --fg3: #824d5b;
    --sel: #e7d2be;
    --comment: #837a72;
    --red: #a5222f;
    --green: #396847;
    --yellow: #ac5402;
    --blue: #2848a9;
    --magenta: #6e33ce;
    --cyan: #287980;
    --orange: #955f61;
    --pink: #a440b5;
    color-scheme: light;
  }
}

/* ------------------------------------------------------------------
   base
------------------------------------------------------------------- */

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

body {
  font-family: "JetBrainsMono Nerd Font", "JetBrainsMono NF",
    "JetBrains Mono", ui-monospace, monospace;
  background: var(--bg0);
  color: var(--fg1);
  line-height: 1.6;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--sel);
}

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

main {
  flex: 1;
  width: min(46rem, 100% - 3rem);
  margin-inline: auto;
  padding-block: 2rem 5rem;
}

p, ul, ol {
  margin-block: 1rem;
}

ul, ol {
  padding-left: 1.4rem;
}

li::marker {
  color: var(--fg3);
}

main a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: var(--bg3);
  text-underline-offset: 3px;
}

main a:hover {
  text-decoration-color: currentColor;
}

hr {
  border: 0;
  border-top: 1px solid var(--bg3);
  margin-block: 2.5rem;
}

code {
  background: var(--bg2);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}

pre {
  background: var(--bg1);
  border-left: 3px solid var(--bg3);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-block: 1.25rem;
}

:root[data-theme="light"] pre,
:root[data-theme="light"] code {
  background: var(--bg2);
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

blockquote {
  border-left: 3px solid var(--bg3);
  padding-left: 1.25rem;
  color: var(--fg2);
  margin-block: 1.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-block: 1.5rem;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--bg3);
}

thead th {
  color: var(--fg0);
  font-weight: 800;
  background: var(--bg1);
}

tbody tr:nth-child(even) td {
  background: var(--bg1);
}

:root[data-theme="light"] thead th,
:root[data-theme="light"] tbody tr:nth-child(even) td {
  background: var(--bg2);
}

/* ------------------------------------------------------------------
   headings — heavy, tight, lowercase
------------------------------------------------------------------- */

h1, h2, h3 {
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--fg0);
}

h1 {
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  margin-block: 2.5rem 1.5rem;
}

h2 {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  margin-block: 3rem 0.75rem;
}

h3 {
  font-size: 1.15rem;
  margin-block: 1.75rem 0.5rem;
}

.hero {
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--fg0);
  margin-block: 3rem 4rem;
}

.hero .dim {
  color: var(--fg3);
}

.muted {
  color: var(--fg3);
}

/* blinking terminal cursor — scales with the text it follows */
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 0.12em;
  margin-left: 0.12em;
  background: var(--fg0);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

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

/* ------------------------------------------------------------------
   markdown content — terminal accents
------------------------------------------------------------------- */

.content h2::before,
article .content h2::before {
  content: "## ";
  color: var(--comment);
  font-weight: 400;
  letter-spacing: 0;
}

.content h3::before {
  content: "### ";
  color: var(--comment);
  font-weight: 400;
  letter-spacing: 0;
}

.content ul {
  list-style-type: "- ";
  padding-left: 1.2rem;
}

/* ------------------------------------------------------------------
   interior header / footer
------------------------------------------------------------------- */

.site-header {
  width: min(46rem, 100% - 3rem);
  margin-inline: auto;
  padding-block: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.5rem;
}

.wordmark {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--fg0);
}

.site-header nav {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.site-header nav a {
  color: var(--fg3);
}

.site-header nav a:hover {
  color: var(--fg0);
}

.site-header nav a[aria-current="page"] {
  color: var(--fg0);
}

.site-header nav a[aria-current="page"]::before {
  content: "./";
  color: var(--comment);
}

#theme-toggle {
  font: inherit;
  font-size: 0.8rem;
  background: none;
  border: 0;
  color: var(--fg3);
  cursor: pointer;
  padding: 0;
}

#theme-toggle:hover {
  color: var(--fg0);
}

#theme-toggle::before { content: "["; }
#theme-toggle::after  { content: "]"; }

footer {
  margin-top: auto;
  padding-block: 1.5rem;
  text-align: center;
  color: var(--fg3);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------------
   landing page
------------------------------------------------------------------- */

.landing main {
  width: 100%;
  margin: 0;
  padding: 0.5rem 1rem 0;
}

@media (min-width: 640px) {
  .landing main {
    padding-inline: 2rem;
  }
}

.landing h1 {
  font-size: clamp(3.4rem, 14vw, 8.5rem);
  line-height: 0.95;
  margin-block: 0 0;
}

.landing nav ul {
  list-style: none;
  margin-top: 5rem;
  padding: 0;
}

.landing nav li {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-block: 1rem;
}

.landing nav a {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--fg0);
  text-decoration: none;
}

.landing nav a:hover {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.landing nav .desc {
  color: var(--fg3);
  opacity: 0;
  transition: opacity 0.3s;
  display: none;
}

@media (min-width: 768px) {
  .landing nav .desc { display: block; }
}

.landing nav li:hover .desc,
.landing nav li:focus-within .desc {
  opacity: 1;
}

.landing .corner {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
}

/* ------------------------------------------------------------------
   post feed (posts index)
------------------------------------------------------------------- */

.feed {
  list-style: none;
  padding: 0;
}

.feed li {
  margin-block: 4rem;
}

.feed h2 {
  margin-block: 0 0.5rem;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
}

.feed h2 a {
  color: var(--fg0);
  text-decoration: none;
}

.feed h2 a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.feed .sub {
  color: var(--fg2);
  margin-block: 0.25rem;
}

.meta {
  color: var(--fg3);
  font-size: 0.85rem;
}

.meta::before {
  content: "$ ";
  color: var(--comment);
}

.meta a {
  color: var(--fg3);
}

/* ------------------------------------------------------------------
   article
------------------------------------------------------------------- */

article > header {
  margin-block: 2rem 3rem;
}

article > header h1 {
  margin-block: 0 0.75rem;
}

/* ------------------------------------------------------------------
   projects / cv
------------------------------------------------------------------- */

.project {
  margin-block: 3.5rem;
}

.project h2 {
  margin-block: 0 0.5rem;
}

.project h2 a {
  color: var(--fg0);
  text-decoration: none;
}

.project h2 a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.project p {
  margin-block: 0.25rem;
  color: var(--fg2);
}

.tags {
  color: var(--fg3);
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.cv dt {
  font-weight: 800;
  color: var(--fg0);
  margin-top: 1.5rem;
}

.cv dt .where {
  color: var(--fg2);
  font-weight: 400;
}

.cv dt time {
  display: block;
  color: var(--fg3);
  font-weight: 400;
  font-size: 0.85rem;
}

.cv dd {
  color: var(--fg2);
  margin-left: 0;
}
