/* SHARED BASE — loaded by both the Frost Rank product pages
   (public/assets/frostrank/style.css) and the personal portfolio page
   (public/assets/style.css), which are otherwise two independently-maintained
   stylesheets with a different color palette each. This file holds exactly the
   rules that are structurally identical between them (or differ only by a color
   this page's own :root already parametrizes) — nav skeleton, the Tools dropdown
   + its "read the guide" badge, breadcrumbs, section headers, the FAQ component,
   and the mobile nav-toggle behavior. It's loaded BEFORE each page's own
   stylesheet, so a page-specific file can still add or override something of its
   own after this without a specificity fight.

   Why this file exists: the Tools dropdown's guide-badge CSS was added to the
   Frost Rank stylesheet at some point and never ported to the portfolio page's,
   even though both render the exact same <x-frostrank.tools-dropdown> component —
   so the portfolio page's dropdown silently broke (badges unstyled, rows stacking
   instead of sitting side by side) with nothing to catch it. Moving the actually-
   shared pieces here means a future change to one of them reaches both pages by
   construction, not by remembering to copy it twice.

   Requires each page's own stylesheet to define: --bg, --bg-rgb, --bg-soft,
   --card, --card-border, --text, --muted, --mono, --shadow (RGB triplet), and
   --accent-text (the color this page uses for interactive/accent text — on a
   single-hue page this may just equal --line1; see that file's own :root
   comment), plus --line1-rgb and --line2-bright-rgb (the RGB-triplet form of
   those two colors, for use inside rgba()). */

*{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  background:var(--bg);
  color:var(--text);
  font-family:'Inter',sans-serif;
  line-height:1.6;
  overflow-x:hidden;
}
h1,h2,h3{font-family:'Space Grotesk',sans-serif;}
.mono{font-family:'JetBrains Mono',monospace;}
a{color:inherit;text-decoration:none;}
/* position:relative + z-index:1 here (not just on .hero .wrap, which already had
   its own override) — .bg-grid/.bg-glow below are position:fixed, which makes
   them positioned elements that paint ABOVE ordinary unpositioned content
   regardless of their z-index:0, per normal CSS stacking rules. Every section
   using plain .wrap (About, Tools, Features, FAQ, Contact, Stats — everything
   except the hero) had no override, so its text was technically rendering
   underneath the fixed background layer whenever it scrolled into the same
   on-screen band the glow occupies. This lifts all of it above by default. */
.wrap{max-width:1160px;margin:0 auto;padding:0 24px;position:relative;z-index:1;}

.bg-grid{
  position:fixed;inset:0;z-index:0;pointer-events:none;
  background-image:
    linear-gradient(rgba(var(--line1-rgb),0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--line1-rgb),0.06) 1px, transparent 1px);
  background-size:48px 48px;
  mask-image:radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}
.bg-glow{
  position:fixed;top:-200px;left:50%;transform:translateX(-50%);
  width:900px;height:500px;z-index:0;pointer-events:none;
  background:radial-gradient(ellipse at center, rgba(var(--line1-rgb),0.14), rgba(var(--line2-bright-rgb),0.07) 45%, transparent 75%);
  filter:blur(10px);
}

@keyframes fadeUp{
  from{opacity:0;transform:translateY(14px);}
  to{opacity:1;transform:translateY(0);}
}
@keyframes pulse{0%,100%{opacity:1;}50%{opacity:0.3;}}

/* NAV skeleton (the brand mark itself stays page-specific: Frost Rank animates an
   inline snowflake glyph next to the wordmark, the portfolio page doesn't). */
nav{
  position:sticky;top:0;z-index:50;
  background:rgba(var(--bg-rgb),0.82);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--card-border);
}
nav .wrap{display:flex;align-items:center;justify-content:space-between;height:64px;}
.nav-links{display:flex;gap:28px;align-items:center;}
.nav-links a{font-size:0.9rem;color:var(--muted);transition:color .2s;}
.nav-links a:hover{color:var(--text);}
.nav-toggle-input{display:none;}
.nav-toggle{
  display:none;flex-direction:column;justify-content:center;gap:4px;
  width:32px;height:32px;cursor:pointer;
}
.nav-toggle span{width:100%;height:2px;background:var(--text);border-radius:2px;transition:transform .2s, opacity .2s;}

/* NAV DROPDOWN + guide badge — the piece that actually broke. Sizes (min-width,
   row padding) are the same fixed numbers on both pages by request, not
   per-page variables — a dropdown row should look and feel identical everywhere
   this component appears. */
.nav-dropdown{position:relative;}
.nav-dropdown-btn{
  color:var(--muted);font-size:0.9rem;font-family:'Inter',sans-serif;
  display:flex;align-items:center;gap:4px;cursor:pointer;list-style:none;transition:color .2s;
}
.nav-dropdown-btn::-webkit-details-marker{display:none;}
.nav-dropdown-btn:hover{color:var(--text);}
.caret{width:11px;height:11px;flex-shrink:0;transition:transform .2s;}
.nav-dropdown[open] .caret{transform:rotate(180deg);}
.dropdown-menu{
  position:absolute;top:calc(100% + 10px);left:50%;transform:translateX(-50%);
  background:var(--card);border:1px solid var(--card-border);border-radius:12px;
  padding:8px;min-width:320px;box-shadow:0 20px 40px -16px rgba(var(--shadow),0.18);
  z-index:60;
}
.dropdown-item{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:6px 12px;border-radius:8px;font-size:0.86rem;color:var(--text);
  transition:background .15s;white-space:nowrap;
}
.dropdown-item:hover{background:var(--bg-soft);}
/* .dropdown-item is itself the link to the tool, so the guide link is a flex
   sibling, not nested — nested anchors are invalid HTML. */
.dropdown-row{display:flex;align-items:center;gap:2px;}
.dropdown-row .dropdown-item{flex:1;}
/* Guide badge — one shared appearance for both the nav dropdown rows and any
   tool/skill card's corner badge, so the two can't drift apart again. Scoped as
   `.nav-links .dropdown-guide-link` (0,2,0) rather than the bare class (0,1,0)
   on purpose: `.nav-links a` above is (0,1,1) and would otherwise win. */
.tool-guide-badge,
.nav-links .dropdown-guide-link{
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
  width:26px;height:26px;padding:0;border-radius:50%;
  background:var(--card);border:1px solid var(--card-border);color:var(--accent-text);
  font-size:0.85rem;font-weight:700;line-height:1;text-decoration:none;
  transition:border-color .15s,transform .15s;
}
.tool-guide-badge:hover,
.nav-links .dropdown-guide-link:hover{color:var(--accent-text);border-color:var(--accent-text);transform:scale(1.1);}

.nav-search-form{
  display:flex;align-items:center;gap:6px;background:var(--bg-soft);
  border:1px solid var(--card-border);border-radius:999px;padding:6px 12px;
  transition:border-color .15s;
}
.nav-search-form:focus-within{border-color:var(--line1);}
.nav-search-icon{width:15px;height:15px;flex-shrink:0;color:var(--muted);}
.nav-search-input{
  border:none;background:none;outline:none;width:110px;
  font-family:inherit;font-size:0.84rem;color:var(--text);
}
.nav-search-input::placeholder{color:var(--muted);}

/* Site-wide pagination (see resources/views/vendor/pagination/frostrank.blade.php) */
.pagination-nav{margin-top:24px;}
.pagination-list{display:flex;flex-wrap:wrap;gap:6px;list-style:none;padding:0;margin:0;}
.pagination-item a,
.pagination-item span{
  display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:38px;
  padding:0 10px;border-radius:9px;border:1px solid var(--card-border);
  font-size:0.86rem;color:var(--text);background:var(--card);
}
.pagination-item a{transition:border-color .15s,background .15s;}
.pagination-item a:hover{border-color:var(--line1);color:var(--accent-text);}
.pagination-item.is-current span{background:var(--line1);border-color:var(--line1);color:#fff;font-weight:600;}
.pagination-item.is-disabled span{color:var(--muted);cursor:not-allowed;}
.pagination-item.is-dots span{border:none;background:none;color:var(--muted);}

/* BREADCRUMBS */
.breadcrumbs{padding:16px 0 0;position:relative;z-index:2;}
.breadcrumbs ol{display:flex;flex-wrap:wrap;align-items:center;gap:6px;list-style:none;}
.breadcrumbs li{display:flex;align-items:center;gap:6px;}
.breadcrumbs a,
.breadcrumbs [aria-current="page"]{font-family:'JetBrains Mono',monospace;font-size:0.78rem;}
.breadcrumbs a{color:var(--muted);transition:color .15s;}
.breadcrumbs a:hover{color:var(--accent-text);}
.breadcrumbs .crumb-sep{color:var(--card-border);font-size:0.78rem;}
.breadcrumbs [aria-current="page"]{color:var(--text);font-weight:600;}

/* SECTION HEADERS */
.sec-head{max-width:600px;margin-bottom:32px;}
.sec-eyebrow{font-family:'JetBrains Mono',monospace;font-size:0.76rem;color:var(--accent-text);margin-bottom:8px;display:block;}
.sec-head h2{font-size:clamp(1.5rem,3vw,2.05rem);letter-spacing:-0.01em;margin-bottom:10px;}
.sec-head p{color:var(--muted);font-size:0.96rem;}

/* FAQ — reused via <x-frostrank.faq> on both this site and the portfolio page. */
.faq-list{max-width:760px;}
.faq-item{border:1px solid var(--card-border);border-radius:10px;padding:16px;margin-bottom:12px;}
.faq-item:last-child{margin-bottom:0;}
/* .faq-question-row is a <button> (for real keyboard/AT toggle semantics), reset
   back to looking like a plain flex row — none of the default button chrome
   (border, background, system font) should show. */
.faq-question-row{
  display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px;
  width:100%;background:none;border:none;padding:0;font:inherit;text-align:left;cursor:pointer;
}
.faq-question{font-weight:600;font-size:1rem;color:var(--text);}
.faq-chevron{width:18px;height:18px;flex-shrink:0;margin-top:3px;color:var(--accent-text);transition:transform .25s ease;}
/* Collapsed state rotates the chevron to point right instead of down — the same
   "pointing at closed content" convention as a folder-tree disclosure triangle. */
.faq-item:not(.is-open) .faq-chevron{transform:rotate(-90deg);}
/* Animates to the answer's real (variable) height with no JS height measurement —
   grid-template-rows 1fr↔0fr on the wrapper, clipped by overflow:hidden. The
   answer text itself is never removed from the DOM by this — see faq.blade.php. */
.faq-collapse{display:grid;grid-template-rows:1fr;overflow:hidden;transition:grid-template-rows .3s ease;}
.faq-item:not(.is-open) .faq-collapse{grid-template-rows:0fr;}
.faq-collapse > .faq-answer{min-height:0;}
.faq-answer{color:var(--muted);font-size:0.92rem;line-height:1.6;}

/* Mobile section/stats padding is NOT here on purpose — the two pages currently
   use different values (e.g. 48px vs 32px section padding) as a real, deliberate
   difference from separate work on each page, not drift to unify. `.stats` as a
   whole (desktop + mobile) stays owned by each page's own stylesheet so it isn't
   split across two files. */
@media(max-width:860px){
  nav .wrap{flex-wrap:wrap;height:auto;padding-top:14px;padding-bottom:14px;}
  .brand{order:1;}
  .nav-cta{order:2;}
  .nav-toggle{display:flex;order:3;}
  .nav-links{
    order:4;flex-basis:100%;
    display:none;flex-direction:column;align-items:stretch;gap:2px;
    padding-top:14px;margin-top:12px;border-top:1px solid var(--card-border);
  }
  .nav-links a{padding:10px 4px;font-size:0.95rem;}
  .nav-search-form{margin-top:6px;}
  .nav-search-input{width:auto;flex:1;}
  .nav-toggle-input:checked ~ .nav-links{display:flex;}
  .nav-toggle-input:checked ~ .nav-toggle span:nth-child(1){transform:translateY(6px) rotate(45deg);}
  .nav-toggle-input:checked ~ .nav-toggle span:nth-child(2){opacity:0;}
  .nav-toggle-input:checked ~ .nav-toggle span:nth-child(3){transform:translateY(-6px) rotate(-45deg);}

  /* Open menu becomes a fixed, self-scrolling panel so a long Tools list scrolls
     on its own instead of scrolling the page behind it. */
  nav:has(.nav-toggle-input:checked){
    position:fixed;inset:0;overflow-y:auto;-webkit-overflow-scrolling:touch;
    background:var(--bg);backdrop-filter:none;
  }
  body:has(.nav-toggle-input:checked){overflow:hidden;}

  .nav-dropdown-btn{padding:10px 4px;}
  .dropdown-menu{
    position:static;transform:none;width:100%;min-width:0;
    margin-top:2px;padding-left:8px;box-shadow:none;border:none;background:transparent;
  }
}
@media (prefers-reduced-motion: reduce){
  *{animation:none !important;transition:none !important;}
}
