/* ────────────────────────────────────────────
   arne.fismen.no
   ──────────────────────────────────────────── */

/* Fonts */

/* IBM Plex Sans — body */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-400-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-400-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans — italic */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-italic-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-italic-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono — code */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Fraunces — headings */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('fonts/fraunces-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('fonts/fraunces-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url('fonts/fraunces-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url('fonts/fraunces-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokens */

:root {
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-heading: 'Fraunces', serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --bg: #f6f3ed;
  --text: #1a1814;
  --text-muted: #7a7268;
  --border: #dad5cb;
  --accent: #2a7a6a;
  --accent-hover: #1d5f52;

  --measure: 38rem;
  --sp-4: 1rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151311;
    --text: #ece7dd;
    --text-muted: #857d73;
    --border: #2e2b26;
    --accent: #4abba5;
    --accent-hover: #5fcdb6;
  }
}

:root[data-theme="dark"] {
  --bg: #151311;
  --text: #ece7dd;
  --text-muted: #857d73;
  --border: #2e2b26;
  --accent: #4abba5;
  --accent-hover: #5fcdb6;
}

/* Reset */

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

/* Base */

html {
  font-size: 106.25%;
}
@media (min-width: 768px) {
  html { font-size: 112.5%; }
}
@media (min-width: 1200px) {
  html { font-size: 118.75%; }
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */

body > nav,
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

@media (min-width: 768px) {
  body > nav,
  main {
    padding: 0 var(--sp-8);
  }
}

/* Navigation */

body > nav {
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-6);
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
}

@media (min-width: 768px) {
  body > nav {
    padding-top: var(--sp-8);
    padding-bottom: var(--sp-8);
    gap: var(--sp-6);
  }
}

body > nav .logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  text-decoration: none;
  border-bottom: none;
  margin-right: auto;
}

body > nav .logo .logo-bg {
  position: absolute;
  inset: 0;
  background: var(--accent);
  clip-path: polygon(50% 0%, 79.4% 9.5%, 97.6% 34.5%, 97.6% 65.5%, 79.4% 90.5%, 50% 100%, 20.6% 90.5%, 2.4% 65.5%, 2.4% 34.5%, 20.6% 9.5%);
  transition: background 0.12s;
}

body > nav .logo .logo-ripple {
  position: absolute;
  inset: -50%;
  background: var(--accent);
  clip-path: polygon(50% 0%, 79.4% 9.5%, 97.6% 34.5%, 97.6% 65.5%, 79.4% 90.5%, 50% 100%, 20.6% 90.5%, 2.4% 65.5%, 2.4% 34.5%, 20.6% 9.5%);
  opacity: 0;
  pointer-events: none;
}

body > nav .logo:hover .logo-ripple {
  animation: logo-ripple 0.8s ease-out;
}

body > nav .logo svg {
  position: relative;
  width: 0.85rem;
  height: 0.95rem;
  color: var(--bg);
}

body > nav .logo:hover .logo-bg {
  background: var(--accent-hover);
}

body > nav .logo:hover {
  border-bottom: none;
}

@keyframes logo-ripple {
  0% { transform: scale(0.4); opacity: 0.4; }
  100% { transform: scale(1); opacity: 0; }
}

body > nav a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  border-bottom: none;
}

body > nav a:hover {
  color: var(--text);
  border-bottom: none;
}

/* Headings */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 1.75rem;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-4);
}

h3 {
  font-size: 1.125rem;
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-4);
}

/* Links */

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--text-muted) 60%, transparent);
}

a:hover {
  border-bottom-color: var(--accent);
  transition: border-color 0.12s;
}

/* Date headings */

time.date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: var(--sp-8);
  margin-bottom: var(--sp-4);
  border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
  time.date {
    padding-top: var(--sp-12);
  }
}

main > time.date:first-child {
  padding-top: 0;
  border-top: none;
}

/* Articles */

article {
  padding-bottom: var(--sp-8);
}

article header {
  margin-bottom: var(--sp-4);
}

article h1 a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.12s;
}

article h1 a:hover {
  color: var(--text);
  border-bottom-color: var(--border);
}

/* Link posts */
article.link h1 {
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}

/* Link posts — tighter header-to-body */
article.link header {
  display: flex;
  align-items: baseline;
  margin-bottom: 0.5em;
}

/* Link post bookmark — inline on mobile, margin on desktop */
article header a[rel="bookmark"] {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: none;
  padding: 0.1em 0.2em;
  margin-right: 0.2em;
  border-radius: 4px;
  transition: background 0.12s;
  align-self: baseline;
}

@media (min-width: 768px) {
  article header a[rel="bookmark"] {
    margin-left: -2em;
    margin-right: 0.3em;
    width: 1.7em;
    text-align: center;
  }
}

article header a[rel="bookmark"]:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-bottom: none;
}

/* Prose (inside articles) */

article p,
article ul,
article ol,
article blockquote,
article pre {
  margin-bottom: var(--sp-4);
}

article :last-child {
  margin-bottom: 0;
}

article ul,
article ol {
  padding-left: var(--sp-6);
}

article li {
  margin-bottom: 0.25em;
}

article blockquote {
  border-left: 2px solid var(--border);
  padding-left: var(--sp-4);
  color: var(--text-muted);
}

article img {
  max-width: 100%;
  height: auto;
}

article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-8) 0;
}

/* Code */

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  padding: 0.1em 0.3em;
  border-radius: 2px;
}

pre {
  padding: var(--sp-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: 2px;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
  line-height: 1.5;
}

/* Archive */

main > nav ul {
  list-style: none;
}

main > nav li {
  padding: 0.5em 0.5em;
  margin: 0 -0.5em;
  border-radius: 4px;
  transition: background 0.12s;
}

main > nav li:hover {
  background: color-mix(in srgb, var(--text) 4%, transparent);
}

@media (min-width: 768px) {
  main > nav li {
    padding: 0.35em 0.5em;
  }
}

main > nav li a {
  text-decoration: none;
  border-bottom: none;
}

main > nav li a:hover {
  border-bottom: none;
}

main > nav li time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.75em;
}

main > nav li a[rel="bookmark"] {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: none;
  margin-left: 0.25em;
  padding: 0.1em 0.3em;
  border-radius: 2px;
  transition: background 0.12s;
}

main > nav li a[rel="bookmark"]:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-bottom: none;
}

/* Dev bar — design system only, not part of the blog design */

.devbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.devbar a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: none;
}

.devbar a:hover {
  color: var(--text);
  border-bottom: none;
}

.devbar form {
  display: flex;
}

.devbar button {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  cursor: pointer;
}

.devbar button:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

