/* ============================================================
   Diligent Portfolio — Component Styles
   ============================================================ */

/* ---------- TYPOGRAPHY ---------- */
.t-display, .t-h1, .t-h2, .t-h3, .t-h4, .t-h5, .t-h6 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.t-display {
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
}
.t-h1 { font-size: var(--fs-h1); font-weight: 700; line-height: 1.08; letter-spacing: 0; }
.t-h2 { font-size: var(--fs-h2); font-weight: 700; line-height: var(--lh-snug); letter-spacing: 0; }
.t-h3 { font-size: var(--fs-h3); font-weight: 700; line-height: var(--lh-snug); letter-spacing: 0; }
.t-h4 { font-size: var(--fs-h4); font-weight: 600; line-height: var(--lh-snug); letter-spacing: var(--ls-snug); }
.t-h5 { font-size: var(--fs-h5); font-weight: 600; line-height: var(--lh-normal); }
.t-h6 { font-size: var(--fs-h6); font-weight: 600; line-height: var(--lh-normal); }

.t-body-l, .t-body-m, .t-body-s, .t-caption, .t-label, .t-mono {
  font-family: var(--font-body);
  margin: 0;
}
.t-body-l { font-size: var(--fs-body-l); line-height: var(--lh-relaxed); font-weight: 400; }
.t-body-m { font-size: var(--fs-body-m); line-height: var(--lh-relaxed); font-weight: 400; }
.t-body-s { font-size: var(--fs-body-s); line-height: var(--lh-normal); font-weight: 400; color: var(--ink-3); }
.t-caption { font-size: var(--fs-caption); line-height: var(--lh-normal); font-weight: 400; color: var(--ink-3); }
.t-label   { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-widest); text-transform: uppercase; color: var(--ink-3); }
.t-mono    { font-family: var(--font-mono); font-size: var(--fs-mono); line-height: var(--lh-normal); }

/* ---------- BUTTONS ----------
   States mirror the Figma button component (page "DS", node 37:2908).
   Base: Outfit Medium 15 · pill · 8/12 padding · gap 8.
   No transforms/insets — state changes are colour + shadow only.        */
.btn {
  --btn-pad-y: 8px;
  --btn-pad-x: 12px;
  --btn-fs: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;                 /* Outfit Medium */
  font-size: var(--btn-fs);
  letter-spacing: 0;
  line-height: 1;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
  position: relative;
  user-select: none;
}
.btn:focus-visible {
  outline: 2px solid var(--marigold-ui);
  outline-offset: 3px;
}
/* Never underline the label (overrides the global a:hover underline) */
.btn, .btn:hover, .btn:focus, .btn:active { text-decoration: none; }
.btn--sm { --btn-pad-y: 6px;  --btn-pad-x: 10px; --btn-fs: 13px; }
.btn--md { --btn-pad-y: 8px;  --btn-pad-x: 12px; --btn-fs: 15px; }
.btn--lg { --btn-pad-y: 12px; --btn-pad-x: 20px; --btn-fs: 16px; }

/* Optical balance — a lone icon on one side gets +2px padding on the opposite side
   so the label sits visually centred (e.g. trailing icon → wider left padding). */
.btn--icon-end   { padding-left:  calc(var(--btn-pad-x) + 2px); }  /* icon on the right */
.btn--icon-start { padding-right: calc(var(--btn-pad-x) + 2px); }  /* icon on the left  */

/* Primary — marigold pill · text ink, turns white on hover/active */
.btn--primary {
  background: var(--marigold-ui);            /* #E89A14 */
  color: var(--ink);
  box-shadow: 0 2px 4px rgba(21,17,13,0.04);
}
.btn--primary:hover {
  background: var(--marigold-ui-hover);       /* #C77A0C */
  color: #FFFFFF;
  box-shadow: var(--shadow-color-marigold);   /* marigold glow */
}
.btn--primary:active {
  background: var(--marigold-ui-active);       /* #9F5C0E */
  color: #FFFFFF;
  box-shadow: none;
}

/* Secondary — outline ink · fills on hover, deepens on active */
.btn--secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--ink);
}
.btn--secondary:hover {
  background: var(--ink);                      /* #15110D */
  border-color: var(--ink);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(21,17,13,0.09);
}
.btn--secondary:active {
  background: var(--ink-2);                    /* #2A2520 */
  border-color: var(--ink-2);
  color: #FFFFFF;
  box-shadow: none;
}

/* Ghost — text only · tinted on hover/active, marigold ring on focus */
.btn--ghost {
  background: transparent;
  color: var(--ink);
}
.btn--ghost:hover  { background: var(--neutral-100); }   /* #F4F2EC */
.btn--ghost:active { background: var(--neutral-200); }   /* #E8E4DA */
.btn--ghost:focus-visible {
  outline: none;
  border-color: var(--marigold-ui);           /* #E89A14 */
}

/* Icon — circular · neutral border, turns ink on hover */
.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--paper);
  border-color: var(--neutral-300);           /* #D6D0C2 */
  color: var(--ink);
}
.btn--icon:hover { border-color: var(--ink); }

/* States */
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.btn--loading {
  pointer-events: none;
  color: transparent !important;
}
.btn--loading::before {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  color: var(--ink);
  animation: spin 700ms linear infinite;
}
.btn--primary.btn--loading::before { color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- CARDS ---------- */
.card {
  background: var(--paper);
  border-radius: var(--r-lg);
  border: 1px solid var(--neutral-200);
  overflow: hidden;
  transition:
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--neutral-300);
}

.card--project { display: flex; flex-direction: column; }
.card--project .thumb {
  aspect-ratio: 4 / 3;
  background: var(--neutral-100);
  position: relative;
  overflow: hidden;
}
.card--project .thumb::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(21,17,13,0.04) 12px 13px);
}
.card--project .meta {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card--project .meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card--stat {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.card--stat .stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 56px;
  line-height: 1;
  letter-spacing: var(--ls-tight);
}
.card--content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- TAGS / CHIPS ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: var(--r-pill);
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.tag--filled-marigold { background: var(--marigold-100); color: var(--marigold-text); }
.tag--filled-magenta  { background: var(--magenta-100);  color: var(--magenta-text); }
.tag--filled-teal     { background: var(--teal-100);     color: var(--teal-text); }
.tag--filled-neutral  { background: var(--neutral-100);  color: var(--ink-2); }

.tag--outline-marigold { border-color: var(--marigold-300); color: var(--marigold-text); }
.tag--outline-magenta  { border-color: var(--magenta-300);  color: var(--magenta-text); }
.tag--outline-teal     { border-color: var(--teal-300);     color: var(--teal-text); }
.tag--outline-neutral  { border-color: var(--neutral-300);  color: var(--ink-2); }

.tag--removable .x {
  display: inline-flex;
  width: 14px; height: 14px;
  border-radius: 50%;
  align-items: center; justify-content: center;
  background: rgba(21,17,13,0.08);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}
.tag--removable .x:hover { background: rgba(21,17,13,0.16); }

/* ---------- LISTS ---------- */
.list { padding-left: 0; list-style: none; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.list li { display: flex; gap: 14px; align-items: flex-start; line-height: var(--lh-relaxed); }
.list--bulleted li::before {
  content: "";
  flex-shrink: 0;
  width: 8px; height: 8px;
  margin-top: 10px;
  border-radius: 50%;
  background: var(--marigold-ui);
}
.list--numbered { counter-reset: i; }
.list--numbered li { counter-increment: i; }
.list--numbered li::before {
  content: counter(i, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--magenta-ui);
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 4px;
  width: 28px;
  letter-spacing: 0.02em;
}
.list--checklist li::before {
  content: "";
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 4px;
  border-radius: 5px;
  background: var(--teal-100) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3 8l3 3 7-7' fill='none' stroke='%230F5A5D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/12px no-repeat;
}
.list--def { display: grid; grid-template-columns: max-content 1fr; column-gap: 28px; row-gap: 14px; }
.list--def dt { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.list--def dd { margin: 0; color: var(--ink-3); }

/* ---------- ACCORDION ---------- */
.accordion { display: flex; flex-direction: column; }
.accordion details {
  border-top: 1px solid var(--neutral-200);
  padding: 0;
}
.accordion details:last-child { border-bottom: 1px solid var(--neutral-200); }
.accordion summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 4px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: var(--ls-snug);
  color: var(--ink);
  transition: color var(--dur-fast);
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { color: var(--marigold-text); }
.accordion .icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  transition: transform var(--dur-base) var(--ease-spring), background var(--dur-base);
}
.accordion .icon::before, .accordion .icon::after {
  content: "";
  position: absolute;
  background: var(--ink);
  transition: transform var(--dur-base) var(--ease-spring);
}
.accordion .icon::before { width: 14px; height: 1.5px; }
.accordion .icon::after  { width: 1.5px; height: 14px; }
.accordion details[open] .icon { background: var(--ink); transform: rotate(180deg); }
.accordion details[open] .icon::before { background: var(--paper); }
.accordion details[open] .icon::after  { transform: rotate(90deg); }
.accordion .body {
  padding: 0 4px 28px;
  color: var(--ink-3);
  font-size: 16px;
  line-height: var(--lh-relaxed);
  max-width: 64ch;
  animation: fadeUp var(--dur-base) var(--ease-out);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- ORNAMENTS ---------- */
/* 1. Blob */
.orn-blob {
  position: absolute;
  filter: blur(0.5px);
  pointer-events: none;
}

/* 2. Marquee */
.marquee {
  overflow: hidden;
  border-block: 1.5px solid var(--ink);
  background: var(--marigold-300);
  color: var(--ink);
  padding: 14px 0;
}
.marquee-track {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: scroll 30s linear infinite;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: var(--ls-snug);
}
.marquee-track > span { display: inline-flex; align-items: center; gap: 48px; }
@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* 3. Sticker callout */
.sticker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 132px; height: 132px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.05;
  padding: 14px;
  letter-spacing: var(--ls-snug);
  transform: rotate(-9deg);
  box-shadow: var(--shadow-md);
  text-transform: uppercase;
}
.sticker--magenta { background: var(--magenta-ui); color: #FFF; }
.sticker--teal { background: var(--teal-200); color: var(--teal-text); }

/* 4. Asymmetric divider */
.divider-asymmetric {
  display: grid;
  grid-template-columns: 80px 1fr 24px;
  align-items: center;
  gap: 14px;
}
.divider-asymmetric .seg {
  height: 1.5px;
  background: var(--ink);
}
.divider-asymmetric .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--magenta-ui);
}

/* 5. Dot grid */
.dot-grid {
  background-image: radial-gradient(var(--neutral-300) 1.2px, transparent 1.4px);
  background-size: 18px 18px;
  background-position: 0 0;
}

/* 6. Tape strip */
.tape {
  position: relative;
  display: inline-block;
  padding: 6px 24px;
  background: rgba(241, 178, 50, 0.65);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--ink);
  transform: rotate(-2deg);
  box-shadow: 0 1px 2px rgba(21,17,13,0.06);
}
.tape::before, .tape::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 6px;
  background-image:
    linear-gradient(to right, transparent 50%, rgba(255,255,255,0.4) 50%);
  background-size: 4px 100%;
}
.tape::before { left: 0; }
.tape::after  { right: 0; }

/* 7. Squiggle */
.squiggle {
  display: block;
  width: 100%;
  height: 14px;
}

/* ---------- HELPERS ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1.5px;
  background: var(--marigold-ui);
}

.swatch {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.swatch .chip {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px rgba(21,17,13,0.06);
}
.swatch .label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.swatch .label b { color: var(--ink); font-weight: 600; }

.token-row {
  display: grid;
  grid-template-columns: 200px 80px 1fr;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--neutral-200);
  font-family: var(--font-mono);
  font-size: 13px;
}
.token-row:last-child { border-bottom: 1px solid var(--neutral-200); }
.token-row .name { color: var(--ink); font-weight: 600; }
.token-row .visual {
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--neutral-100);
}
.token-row .desc { color: var(--ink-3); font-family: var(--font-body); font-size: 14px; }

/* ─────────────────────────  SITE TOP NAV  ─────────────────────────
   Sticky global nav — Figma "Top Nav" (88:1540). White bar 72px tall
   (40px row + 16/16 padding), 1px border-1 underline, soft 1px shadow.
   Logo left (Syne ExtraBold 30 · −2% tracking), ghost-button links
   right (itemSpacing 8). Links reuse the DS Ghost button verbatim.
   ------------------------------------------------------------------ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);                     /* #FFFFFF (fill 3:181) */
  border-bottom: 1px solid var(--border-1);     /* #E8E4DA (stroke 3:184) */
  box-shadow: 0 1px 2px rgba(21, 17, 13, 0.04); /* drop shadow 0 1 2 · ink 4% */
}
.site-nav__inner {
  padding: 16px 48px;           /* full-bleed; 48px gutters */
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
/* Specificity (0,2,0) so the ink logo beats the global a:not(.btn) link colour (0,1,1) */
.site-nav .site-nav__logo {
  font-family: var(--font-display);
  font-weight: 800;                             /* Syne ExtraBold */
  font-size: 30px;
  letter-spacing: -0.02em;                      /* −2% */
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
/* Logo is inert — no colour shift, no underline in any state */
.site-nav .site-nav__logo:hover,
.site-nav .site-nav__logo:focus,
.site-nav .site-nav__logo:active {
  color: var(--ink);
  text-decoration: none;
}
.site-nav__links { display: flex; align-items: center; gap: 8px; }
.site-nav__links .btn svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 720px) {
  .site-nav__inner { padding: 12px 24px; min-height: 60px; }
  .site-nav__links { gap: 2px; }
  .site-nav__links .btn { --btn-pad-x: 10px; }
}
@media print { .site-nav { display: none !important; } }
