/* The shared component layer: the same parts as Applied AI, Simplified (web/src/app/globals.css),
   so the portfolio and the guide read as one system. Loaded last on every page.
   See DESIGN.md at the repo root for the rules.

   1 tokens · 2 label · 3 tag · 4 filter · 5 buttons · 6 icon buttons · 7 corners */

/* 1 tokens: the frame's corner, two control heights, wood and beads */
:root {
  --r-tag: 4px; --h-sm: 32px; --h-md: 44px;
  --line-hair: rgba(28, 28, 30, 0.14); --line-strong: rgba(28, 28, 30, 0.22);
  --dowel: linear-gradient(90deg, #b48a5c 0%, #d8bb94 24%, #f1e3cc 48%, #dcc29e 70%, #ad8455 100%);
  --rod: linear-gradient(180deg, #e9d8bd 0%, #f4eadb 35%, #d2b48d 75%, #b8946a 100%);
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
}

/* 2 label: a section's name. Mono capitals, a rust wash, the frame's corner, led by a red bead */
.section-label, .eyebrow {
  border-radius: var(--r-tag) !important;
  font-family: var(--font-mono, "Geist Mono", ui-monospace, monospace) !important; font-size: 0.72rem !important;
  font-weight: 500 !important; letter-spacing: 0.12em !important; text-transform: uppercase !important;
}

/* 3 tag: a fact on a card. A white face, a hairline, a small wooden post on its left.
   The one that matters (peer-reviewed, a concept, the featured case): an ink face, a red post. */
.case-tag, .gallery-tag, .xp-tags span, .pub-badge, .news-tag, .rs-tag, .sb-chip {
  position: relative !important; display: inline-flex !important; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 10px 0 14px !important; border: 0 !important; border-radius: var(--r-tag) !important;
  background: #fff !important; box-shadow: inset 0 0 0 1px var(--line-hair) !important; outline: 0 !important;
  font-family: var(--font, "Vahid Sora", system-ui, sans-serif) !important; font-size: 0.75rem !important; font-weight: 600 !important;
  letter-spacing: 0 !important; text-transform: none !important; color: #1c1c1e !important; white-space: nowrap; line-height: 1.2;
}
.case-tag::before, .gallery-tag::before, .xp-tags span::before, .pub-badge::before, .news-tag::before, .rs-tag::before, .sb-chip::before {
  content: "" !important; position: absolute !important; left: 4px; top: 5px; bottom: 5px; width: 4px; height: auto !important;
  border-radius: 2px !important; background: var(--dowel) !important; margin: 0 !important; transform: none !important;
}
.case-card.featured .case-tag:first-child, .pub-badge.acm, .case-tag-concept, .rs-tag.rs-peer {
  background: #1c1c1e !important; color: #fff !important; box-shadow: none !important;
}
.case-card.featured .case-tag:first-child::before, .pub-badge.acm::before, .case-tag-concept::before, .rs-tag.rs-peer::before {
  background: var(--bead-red, #e0301e) !important;
}

/* 4 filter: a tag you can press. Same face; pressed is the ink face with a red post */
.year-pill, .topic-pill, .fit-chip, .fx-pill, .fx-sample, .lg-toc a, .news-links a {
  position: relative !important; display: inline-flex !important; align-items: center; gap: 6px;
  min-height: var(--h-sm) !important; padding: 0 12px 0 16px !important; border: 0 !important; border-radius: var(--r-tag) !important;
  background: #fff !important; box-shadow: inset 0 0 0 1px var(--line-hair) !important;
  font-family: var(--font, "Vahid Sora", system-ui, sans-serif) !important; font-size: 0.8rem !important; font-weight: 600 !important;
  color: #1c1c1e !important; text-decoration: none !important; cursor: pointer; white-space: nowrap;
  transition: transform 0.25s var(--spring), background 0.2s, color 0.2s !important;
}
.year-pill::before, .topic-pill::before, .fit-chip::before, .fx-pill::before, .fx-sample::before, .lg-toc a::before, .news-links a::before {
  content: "" !important; position: absolute !important; left: 4px; top: 6px; bottom: 6px; width: 4px; height: auto !important;
  border-radius: 2px !important; background: var(--dowel) !important; transition: background 0.2s;
}
.year-pill:hover, .topic-pill:hover, .fit-chip:hover, .fx-pill:hover, .fx-sample:hover, .lg-toc a:hover, .news-links a:hover { transform: translateX(2px); }
.year-pill:hover::before, .topic-pill:hover::before, .fit-chip:hover::before, .fx-pill:hover::before, .fx-sample:hover::before, .lg-toc a:hover::before, .news-links a:hover::before { background: #e0301e !important; }
:is(.year-pill, .topic-pill, .fit-chip, .fx-pill, .fx-sample):is(.active, .on, .is-on, [aria-pressed="true"], [aria-selected="true"]) {
  background: #1c1c1e !important; color: #fff !important; box-shadow: none !important;
}
:is(.year-pill, .topic-pill, .fit-chip, .fx-pill, .fx-sample):is(.active, .on, .is-on, [aria-pressed="true"], [aria-selected="true"])::before { background: var(--bead-red, #e0301e) !important; }

/* 5 buttons: two heights. The main action is ink; the second is an outline. Both rise on hover. */
.btn, .lg-btn, .btn-ghost, .rs-cta a {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h-md); min-height: var(--h-md); padding: 0 20px; border-radius: var(--r-tag) !important;
  font-size: 0.92rem; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none !important;
  transition: transform 0.25s var(--spring), background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover, .lg-btn:hover, .btn-ghost:hover, .rs-cta a:hover { transform: translateY(-2px); }
.btn-primary, .rs-cta a.btn-primary { background: #1c1c1e !important; color: #fff !important; border: 1px solid #1c1c1e !important; box-shadow: none !important; }
.btn-primary:hover { background: #000 !important; }
.btn-outline, .btn-ghost, .rs-cta a:not(.btn-primary) { background: #fff; color: #1c1c1e !important; border: 1px solid var(--line-strong) !important; box-shadow: none !important; }
.btn-outline:hover, .btn-ghost:hover, .rs-cta a:not(.btn-primary):hover { border-color: #1c1c1e !important; background: var(--paper, #fff6f4); }
.btn-sm, .rc-copy { height: var(--h-sm) !important; min-height: var(--h-sm) !important; padding: 0 14px !important; font-size: 0.8rem !important; border-radius: var(--r-tag) !important; }
/* the featured guide keeps its second action as an underlined text link, by design */
.aai-feat .cta-actions .btn-outline { background: none !important; border-color: transparent !important; }

/* 6 icon buttons: one size, ink line icons in a framed square; the brand colours only on hover */
.hero-links a, .reel-share a, .vf-soc {
  display: inline-grid !important; place-items: center; width: 34px !important; height: 34px !important; padding: 0 !important;
  border-radius: var(--r-tag) !important; border: 1px solid var(--line-hair) !important; background: #fff !important;
  color: #1c1c1e !important; transition: border-color 0.16s, color 0.16s, transform 0.3s var(--spring) !important;
}
.hero-links a:hover, .reel-share a:hover, .vf-soc:hover { border-color: #e0301e !important; color: #b4200f !important; transform: translateY(-1px); }
.hero-links a svg, .reel-share a svg, .vf-soc svg { width: 15px !important; height: 15px !important; }
.hero-links a img { width: 16px !important; height: 16px !important; filter: grayscale(1) contrast(1.2); }
.hero-links { gap: 6px !important; }

/* the "What I bring" flip cards keep their grid; they take the frame's corner and the wooden post */
#skills .bio-tag { border-radius: var(--r-tag) !important; padding-left: 14px !important; }
#skills .bio-tag::before { content: ""; position: absolute; left: 4px; top: 7px; bottom: 7px; width: 4px; border-radius: 2px; background: var(--dowel); z-index: 1; }
#skills .bio-tag.is-flipped::before { background: #e0301e; }
.news-links a { min-height: 28px !important; font-size: 0.72rem !important; }

/* 7 corners: controls and small cards take the frame's corner */
.site-header .nav-ic, .site-header .nav-links a.nav-ic, .site-header .nav-actions .nav-fit, .site-header .nav-actions .nav-btn-solid.nav-ic, .site-header .nav-toggle,
.hero-door, .hf-icon, .rec-toggle, .fx-in, #fit-input, .reel-mini .reel-thumb { border-radius: var(--r-tag) !important; }
/* the Hugging Face mark is an emoji, not a line icon: greyed with the rest, in colour on hover */
.hero-links a { filter: grayscale(1); }
.hero-links a:hover, .hero-links a:focus-visible { filter: none; }

/* paper pages on phones: result tiles and long links wrap inside the column */
.paper-head .results > .result { min-width: 0; overflow-wrap: anywhere; }
main.wrap a { overflow-wrap: anywhere; }
.paper-head { overflow-x: clip; } /* the result tiles' wooden posts overhang by 3px */
