/* ============================================================
   arne.fismen.no — Design tokens and styles
   ============================================================ */

/* 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 — CSS custom properties
   ============================================================ */
:root {
  /* type */
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-heading: 'Fraunces', serif;
  --font-mono: 'IBM Plex Mono', monospace;

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

  /* space */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* layout */
  --measure: 38rem;

  /* radius */
  --radius-sm: 2px;
  --radius-md: 4px;
}

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

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

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

/* ============================================================
   ELEMENTS — default styling for native HTML
   ============================================================ */

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(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}
h1 { font-size: 1.75rem; letter-spacing: -0.025em; }
h2 { font-size: 1.375rem; letter-spacing: -0.02em; margin-top: var(--space-xl); }
h3 { font-size: 1.125rem; margin-top: var(--space-lg); }
h4 { font-size: 1rem; }
h5 { font-size: 0.9rem; }
h6 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }

p {
  margin-bottom: var(--space-md);
}

small {
  font-size: 0.8125rem;
  color: var(--color-muted);
}

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

ul, ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}
li { margin-bottom: var(--space-xs); }

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-xl) 0;
}

blockquote {
  border-left: 2px solid var(--color-border);
  padding-left: var(--space-md);
  color: var(--color-muted);
  margin-bottom: var(--space-md);
}

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

pre {
  font-family: var(--font-mono);
  padding: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}
pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
  line-height: 1.5;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-md);
}
th, td {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
}
th { font-weight: 600; }

/* ============================================================
   FORMS — buttons and inputs
   ============================================================ */
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  width: 100%;
  max-width: 20rem;
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  margin-right: var(--space-xs);
}

label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-right: var(--space-md);
}

/* ============================================================
   COMPONENTS — blog-specific components
   ============================================================ */

/* Layout */

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-xl);
}

@media (min-width: 768px) {
  main {
    padding: 0 var(--space-xl) var(--space-2xl);
  }
}

/* Navigation */

body > nav {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg) var(--space-lg);
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  body > nav {
    padding: var(--space-xl) var(--space-xl) var(--space-xl);
    gap: var(--space-lg);
  }
}

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(--color-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(--color-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(--color-bg);
}

body > nav .logo:hover .logo-bg {
  background: var(--color-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(--color-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  border-bottom: none;
}

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

/* Date headings */

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

@media (min-width: 768px) {
  time.date {
    padding-top: var(--space-2xl);
  }
}

/* Articles */

article {
  padding-bottom: var(--space-xl);
}

article header {
  margin-bottom: var(--space-md);
}

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

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

/* Link posts */

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

article.link header {
  display: flex;
  align-items: baseline;
  margin-bottom: 0.5em;
}

article header a[rel="bookmark"] {
  font-size: 0.9rem;
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: none;
  padding: 0.1em 0.2em;
  margin-right: 0.2em;
  border-radius: var(--radius-md);
  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(--color-accent) 12%, transparent);
  border-bottom: none;
}

/* Prose (inside articles) */

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

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

article ul,
article ol {
  padding-left: var(--space-lg);
}

article li {
  margin-bottom: 0.25em;
}

article blockquote {
  border-left: 2px solid var(--color-border);
  padding-left: var(--space-md);
  color: var(--color-muted);
}

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

article hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-xl) 0;
}

/* Archive */

main nav ul {
  list-style: none;
}

main nav ul li {
  padding: 0.5em 0.5em;
  margin: 0 -0.5em;
  border-radius: var(--radius-md);
  transition: background 0.12s;
}

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

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

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

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

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

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

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

/* .btn */

.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
}
.btn:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   PROTOTYPE CHROME — styleguide-environment classes only.
   These are NEVER part of a real page; they exist to frame the
   styleguide, component previews, and page previews. All classes
   are namespaced `.prototype-*` so they are easy to find and
   delete if the project ever outgrows this scaffold.
   ============================================================ */

.prototype-page {
  max-width: 48rem;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

.prototype-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.prototype-title h1 {
  margin-bottom: 0;
}
.prototype-subtitle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  margin: 0;
}
.prototype-title-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.prototype-title-actions a {
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  border-bottom: none;
}
.prototype-title-actions a:hover { color: var(--color-text); border-bottom: none; }
.prototype-title-actions button {
  background: transparent;
  border: 1px solid var(--color-muted);
  color: var(--color-muted);
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.prototype-title-actions button:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

.prototype-toc {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}
.prototype-toc li { margin: 0; }
.prototype-toc a { font-family: var(--font-mono); font-size: 0.875rem; border-bottom: none; }
.prototype-toc a:hover { border-bottom: none; }

.prototype-section {
  margin-bottom: var(--space-xl);
  padding-top: var(--space-lg);
}
.prototype-section > h2 {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.prototype-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: var(--space-md);
}
.prototype-swatch {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.prototype-swatch-box {
  aspect-ratio: 2 / 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.prototype-swatch-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
}

.prototype-space-scale {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.prototype-space-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.prototype-space-bar {
  height: 0.75rem;
  background: var(--color-accent);
  border-radius: var(--radius-sm);
}
.prototype-space-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
  min-width: 6rem;
}

.prototype-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-border);
  border-bottom: 1px dashed var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
}
.prototype-header a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  border-bottom: none;
}
.prototype-header a:hover { text-decoration: none; border-bottom: none; }
.prototype-header-spacer { flex: 1; }

.prototype-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.prototype-breadcrumb span { opacity: 0.6; }
.prototype-header button {
  background: transparent;
  border: 1px solid var(--color-muted);
  color: inherit;
  font: inherit;
  padding: 0.1em 0.5em;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
