/* ============================================================
   Atelier Hamidi — Branded Business Experience · CEO Demo
   Shared design tokens & components.
   Extracted from the live identity at atelierhamidi.de (2026-11):
   Cormorant Garamond + Manrope, ink/off-white, brass #d7b06a,
   signal red #d90000, hairline rules.
   ============================================================ */

/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio, geometry.
   Put this @layer first; product CSS outside the layer wins ordinary layout rules.
   Native hidden and closed-dialog states take precedence over component display rules. */
@layer od-layout {
  [hidden]:not([hidden="until-found" i]) { display: none !important; }
  dialog:not([open]) { display: none !important; }

  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }

  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }

  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }

  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }

  .od-icon { display: inline-block; inline-size: var(--od-icon-size, 1em); block-size: var(--od-icon-size, 1em); flex: none; }

  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }
  .od-nowrap  { white-space: nowrap; }
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; }

  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }

  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }

  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
:root [hidden]:where(:not([hidden="until-found" i])) { display: none !important; }
/* /OD-LAYOUT-PRIMITIVES v1 */

/* ---------- Tokens ---------- */
:root {
  /* color — from atelierhamidi.de */
  --paper:      #ffffff;
  --paper-2:    #f1f1f1;
  --paper-3:    #f7f7f5;
  --ink:        #0a0a0a;
  --ink-2:      #313131;
  --ink-3:      #353535;
  --muted:      #5f5f5f;   /* derived from #313131 for ≥4.5:1 on white */
  --line:       #e5e5e5;
  --line-2:     #cbcbcb;
  --brass:      #d7b06a;
  --brass-2:    color-mix(in srgb, #d7b06a 82%, #590000);  /* deep brass #b8934e-class */
  --brass-ink:  #7d5f26;   /* brass-derived, text-safe on white */
  --brass-wash: color-mix(in srgb, #d7b06a 14%, #ffffff);
  --red:        #d90000;   /* signals only */
  --red-ink:    #b40000;
  --red-wash:   color-mix(in srgb, #d90000 7%, #ffffff);
  --oxblood:    #590000;
  --brown:      #5d4645;
  --ok:         #2e7d4f;   /* semantic success */
  --ok-wash:    color-mix(in srgb, #2e7d4f 8%, #ffffff);
  --night:      #101112;   /* dark panels (footer, terminal bezel) */

  /* type */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* scale */
  --t-hero: clamp(44px, 6.4vw, 78px);
  --t-1: clamp(34px, 4vw, 50px);
  --t-2: clamp(26px, 3vw, 34px);
  --t-3: 21px;
  --t-body: 16px;
  --t-small: 14px;
  --t-micro: 12px;

  /* space — 4/8 rhythm */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  --r: 2px;         /* artisan-sharp corners */
  --r-2: 4px;
  --shadow-1: 0 1px 2px rgba(10,10,10,.05), 0 10px 30px rgba(10,10,10,.07);
  --shadow-2: 0 2px 6px rgba(10,10,10,.08), 0 24px 60px rgba(10,10,10,.14);

  --speed: 170ms;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: .002em;
  margin: 0;
}
h1 { font-size: var(--t-hero); }
h2 { font-size: var(--t-1); }
h3 { font-size: var(--t-2); }
h4 { font-family: var(--font-body); font-size: var(--t-small); font-weight: 700; margin: 0; }
p { margin: 0 0 var(--s4); }
p:last-child { margin-bottom: 0; }
a { color: inherit; }
img { max-width: 100%; }
::selection { background: var(--brass); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brass-2);
  outline-offset: 2px;
  border-radius: var(--r);
}
.btn:focus-visible, .tab:focus-visible, .nav a:focus-visible { outline-offset: -2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

.num { font-variant-numeric: tabular-nums; }
.hairline { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }

/* ---------- Layout helpers ---------- */
.wrap { max-width: 1200px; margin-inline: auto; padding-inline: var(--s5); }
.wrap-wide { max-width: 1440px; margin-inline: auto; padding-inline: var(--s5); }
.kicker {
  font-family: var(--font-body);
  font-size: 11px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--brass-ink);
}
.kicker--ink { color: var(--muted); }
.lede { font-size: 18px; line-height: 1.65; color: var(--ink-2); max-width: 62ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font-family: var(--font-body); font-size: var(--t-small); font-weight: 600;
  letter-spacing: .02em; line-height: 1;
  padding: 12px 20px; min-height: 44px;
  border: 1px solid var(--ink); border-radius: var(--r);
  background: var(--paper); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--speed) ease-out, color var(--speed) ease-out,
              border-color var(--speed) ease-out, transform var(--speed) ease-out, box-shadow var(--speed) ease-out;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #000; }
.btn--brass { background: var(--brass); border-color: var(--brass); color: #241a06; font-weight: 700; }
.btn--brass:hover { background: #cfa55d; border-color: #cfa55d; }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--danger { background: transparent; border-color: var(--red); color: var(--red-ink); }
.btn--danger:hover { background: var(--red-wash); }
.btn--sm { padding: 8px 12px; min-height: 34px; font-size: var(--t-micro); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .45; cursor: not-allowed; transform: none; box-shadow: none;
}
.btn--quiet { border-color: transparent; background: transparent; color: var(--ink-2); padding-inline: 10px; }
.btn--quiet:hover { box-shadow: none; background: var(--paper-2); transform: none; }

/* ---------- Surfaces ---------- */
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-2); padding: var(--s5);
}
.card--pad4 { padding: var(--s4); }
.card--night { background: var(--night); border-color: #232427; color: #f3f2ef; }
.card--wash { background: var(--brass-wash); border-color: color-mix(in srgb, #d7b06a 35%, #ffffff); }

/* ---------- Chips, tags, status ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-micro); font-weight: 600; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-2);
}
.chip--brass { border-color: color-mix(in srgb, #d7b06a 55%, #ffffff); background: var(--brass-wash); color: var(--brass-ink); }
.chip--red { border-color: color-mix(in srgb, #d90000 35%, #ffffff); background: var(--red-wash); color: var(--red-ink); }
.chip--ok { border-color: color-mix(in srgb, #2e7d4f 30%, #ffffff); background: var(--ok-wash); color: var(--ok); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; display: inline-block; }
.dot--brass { background: var(--brass); }
.dot--red { background: var(--red); }
.dot--ok { background: var(--ok); }
.dot--brown { background: var(--brown); }
.dot--outline { background: transparent; border: 1.5px solid var(--ink-2); }

/* Odoo implementation classification (design annotation, brief §13) */
.odoo { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body);
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r); border: 1px solid var(--line-2); color: var(--muted); background: var(--paper); }
.odoo--native { color: var(--ink); border-color: var(--ink); }
.odoo--config { color: var(--brown); border-color: var(--brown); }
.odoo--custom { color: var(--brass-ink); border-color: var(--brass); background: var(--brass-wash); }
.odoo--ext { color: var(--red-ink); border-color: color-mix(in srgb, #d90000 45%, #ffffff); }
.odoo--future { color: var(--muted); border-style: dashed; }

/* Simulation honesty label */
.sim {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r);
  border: 1px dashed var(--brass-2); color: var(--brass-ink); background: var(--paper);
}

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--red); }
.input, .select, .textarea {
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--paper);
  transition: border-color var(--speed) ease-out;
  width: 100%;
}
.textarea { min-height: 96px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field .err { font-size: 12.5px; color: var(--red-ink); display: none; }
.field.is-invalid .err { display: block; }
.field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .textarea { border-color: var(--red); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); margin: 2px 0 0; flex: none; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--line-2);
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table th.num { text-align: right; }
.table tbody tr:hover { background: var(--paper-3); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--s2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab {
  appearance: none; background: none; border: 0; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--muted);
  padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--speed) ease-out, border-color var(--speed) ease-out;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brass); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 90; right: var(--s5); bottom: var(--s5);
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; border-radius: var(--r);
  padding: 12px 18px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-2); max-width: min(420px, calc(100vw - 48px));
}
.toast .dot { background: var(--brass); }

/* ---------- Progress / timeline ---------- */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 var(--s4) 26px; }
.tl li::before {
  content: ""; position: absolute; left: 4px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--line-2);
}
.tl li::after {
  content: ""; position: absolute; left: 9px; top: 18px; bottom: -2px;
  width: 1px; background: var(--line);
}
.tl li:last-child { padding-bottom: 0; }
.tl li:last-child::after { display: none; }
.tl li.done::before { background: var(--brass); border-color: var(--brass); }
.tl li.now::before { border-color: var(--ink); background: var(--ink); }
.tl .t { font-size: 12px; color: var(--muted); display: block; }

/* ---------- Generic responsive ---------- */
@media (max-width: 768px) {
  .wrap, .wrap-wide { padding-inline: var(--s4); }
  .lede { font-size: 16px; }
}
