/* 
   Global base styles for all pages.
*/

/* 
   Theme tokens
*/
:root{
  --container: 900px;
  --radius: 16px;
  --radius-sm: 12px;
}

:root[data-theme="light"]{
  --bg:#f6f6f7;
  --fg:#111318;
  --muted:#334155cc;

  --card:#ffffff;
  --border:#e5e7eb;
  --accent:#3f6fc2;

  --color: #fff;
  --shadow: 0 2px 14px rgba(0,0,0,.08);
}

:root[data-theme="dark"]{
  --bg:#0f1218;
  --fg:#e8d9c3;
  --muted:#cbd5e199;

  --card:#121520;
  --border:#2a2f3a;
  --accent:#d7b46a;

  --color: #000;
  --shadow: 0 2px 12px rgba(0,0,0,.25);
}

/* ─────────────────────────────
   Base / resets
   ───────────────────────────── */
*{ box-sizing: border-box; }

html,body{
  background: var(--bg);
  color: var(--fg);
  transition: background-color .25s, color .25s;
}

body{
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial;
  font-size: 16px;
  line-height: 1.6;
}

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

a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }

/* ─────────────────────────────
   Layout primitives
   ───────────────────────────── */
.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

section{
  padding: 22px 0;
}

.row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Header/nav */
header{
  border-bottom: 2px solid var(--border);
  padding: 12px 0;
}

nav{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

nav a{
  color: var(--muted);
  text-decoration: none;
}
nav a:hover{
  color: var(--fg);
  text-decoration: none;
}

/* ─────────────────────────────
   Typography
   ───────────────────────────── */
h1,h2,h3{
  margin: 0;
  line-height: 1.25;
}

h1{
  margin: 18px 0 10px;
  font-size: 28px;
}

h2{
  margin: 20px 0 10px;
  font-size: 22px;
}

p{ margin: 10px 0; }

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

code{
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 80%, #9ca3af 20%);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Defaults for lists */
ul{ margin: 10px 0; padding-left: 1.1rem; }
li{ margin: 6px 0; }
li strong{ margin-right: 6px; }

/* divider between sections */
.section-rule{
  border-top: 2px solid var(--border);
  padding-top: 18px;
}

/* center aligning utility class */
.center{ text-align: center; }

.expandable-img {
  cursor: zoom-in;
  transition: transform .15s ease;
}

.expandable-img:hover {
  transform: scale(1.01);
}

.img-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.img-modal-content {
  max-width: 92%;
  max-height: 90%;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  border: 1px solid var(--border);
}