/* Savory UI Theme
   Vibe: earthy + spicy (olive, chili, mustard, black, cream)
   Texture cues: kraft paper, matte black, foil accents, oil-stain highlights
*/

:root{
  /* Core palette */
  --cream: #F6F1E6;
  --kraft: #E7D6B1;
  --matte-black: #121212;
  --charcoal: #1B1D1A;

  --olive: #556B2F;
  --olive-deep: #33411D;

  --chili: #C0392B;
  --mustard: #C9A227;

  /* "Foil" accent (warm metallic) */
  --foil: #C7B37A;

  /* Text */
  --text: #1A1A16;
  --text-muted: #4C4A43;
  --text-on-dark: #F6F1E6;

  /* Surfaces */
  --bg: var(--cream);
  --surface: #FFFBF2;
  --surface-2: #F3E6CC;

  /* Borders & shadows */
  --border: rgba(18, 18, 18, 0.12);
  --shadow: 0 12px 28px rgba(18, 18, 18, 0.18);

  /* Highlights */
  --highlight-bg: rgba(201, 162, 39, 0.35); /* mustard wash */
  --highlight-border: rgba(201, 162, 39, 0.55);

  /* Links */
  --link: var(--olive);
  --link-hover: var(--chili);

  /* Focus */
  --focus: rgba(192, 57, 43, 0.35);

  /* Code */
  --code-bg: rgba(18, 18, 18, 0.05);
  --code-border: rgba(18, 18, 18, 0.10);

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Radius */
  --radius: 14px;
  --radius-sm: 10px;

  /* Layout */
  --content-max: 920px;
}

/* Base / Reset-ish */
*,
*::before,
*::after{ box-sizing: border-box; }

html, body{
  height: 100%;
}

body{
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Subtle “kraft paper + oil stain” feel without heavy noise images */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 15% 10%, rgba(85,107,47,0.10), transparent 55%),
    radial-gradient(900px 700px at 85% 20%, rgba(192,57,43,0.08), transparent 60%),
    radial-gradient(900px 900px at 60% 90%, rgba(201,162,39,0.10), transparent 55%),
    linear-gradient(0deg, rgba(18,18,18,0.03), rgba(18,18,18,0.03));
  mix-blend-mode: multiply;
}

/* Layout helpers */
.container{
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 64px 24px;
}

.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

/* Headings */
h1, h2, h3, h4, h5, h6{
  margin: 0 0 0.6em;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--charcoal);
}

h1{
  font-size: clamp(2.4rem, 4vw, 3.4rem);
}

h2{ font-size: clamp(1.7rem, 2.6vw, 2.2rem); }
h3{ font-size: 1.5rem; }
h4{ font-size: 1.2rem; }
h5{ font-size: 1.05rem; }
h6{ font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }

p{
  margin: 0 0 1em;
  color: var(--text);
}

.lede{
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Text selection */
::selection{
  background: rgba(192,57,43,0.25);
}

/* Highlighted text (use <mark>) */
mark{
  background: var(--highlight-bg);
  border: 1px solid var(--highlight-border);
  border-radius: 8px;
  padding: 0.05em 0.35em;
}

/* Links */
a{
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(85,107,47,0.35);
}
a:hover{
  color: var(--link-hover);
  border-bottom-color: rgba(192,57,43,0.55);
}
a:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-bottom-color: transparent;
}

/* Lists */
ul, ol{
  margin: 0 0 1em;
  padding-left: 1.25em;
}
li{ margin: 0.25em 0; }

/* Horizontal rule */
hr{
  border: 0;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* Quotes */
blockquote{
  margin: 0 0 1.25em;
  padding: 14px 18px;
  border-left: 4px solid var(--olive);
  background: linear-gradient(90deg, rgba(85,107,47,0.10), transparent 55%);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--charcoal);
}
blockquote p{
  margin: 0;
}
blockquote cite{
  display: block;
  margin-top: 10px;
  color: var(--text-muted);
  font-style: normal;
}

/* Inline code and code blocks */
code{
  font-family: var(--font-mono);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 0.15em 0.4em;
  border-radius: 8px;
  font-size: 0.95em;
}

pre{
  margin: 0 0 1.25em;
  padding: 16px 18px;
  background: var(--matte-black);
  color: var(--text-on-dark);
  border-radius: var(--radius);
  overflow: auto;
  border: 1px solid rgba(246,241,230,0.14);
  box-shadow: 0 10px 20px rgba(18,18,18,0.22);
}
pre code{
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

/* Tables */
table{
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td{
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
th{
  background: linear-gradient(180deg, rgba(201,162,39,0.20), transparent);
  color: var(--charcoal);
}
tr:last-child td{ border-bottom: 0; }

/* Forms */
label{
  display: block;
  margin: 0 0 8px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

input, textarea, select{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.65);
  color: var(--text);
  font-family: inherit;
  box-shadow: 0 1px 0 rgba(18,18,18,0.03);
}

input:focus, textarea:focus, select:focus{
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-color: rgba(192,57,43,0.35);
}

::placeholder{ color: rgba(76,74,67,0.65); }

fieldset{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 1.25em;
  background: rgba(255,255,255,0.35);
}

legend{
  padding: 0 10px;
  color: var(--olive-deep);
  font-weight: 700;
}

/* Buttons */
button,
input[type="button"],
input[type="submit"],
input[type="reset"]{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(18,18,18,0.14);
  background: linear-gradient(180deg, rgba(85,107,47,0.95), rgba(51,65,29,0.98));
  color: var(--text-on-dark);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(18,18,18,0.18);
}

button:hover{
  filter: brightness(1.03);
  transform: translateY(-1px);
}

button:active{
  transform: translateY(0px);
}

button.secondary{
  background: linear-gradient(180deg, rgba(201,162,39,0.92), rgba(166,127,22,0.96));
  color: #1A160B;
}

button.danger{
  background: linear-gradient(180deg, rgba(192,57,43,0.96), rgba(136,33,25,0.98));
}

/* Images */
img{
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* Logo */
img.logo{
  height: 1.5em;
  width: auto;
  display: block;
  margin: 0;
  border-radius: 0;
}

/* Small utility */
.muted{ color: var(--text-muted); }
.foil{
  color: var(--foil);
  text-shadow: 0 1px 0 rgba(18,18,18,0.2);
}

.highlight-text{
  font-size: 1.3rem;
  font-weight: 600;
  text-align: left;
  color: var(--olive-deep);
  letter-spacing: 0.05em;
  margin: 1.5em 0;
}
