/* Next Hat public shell, aligned with the shared PublicHeader and service pages.
   Forgejo's selected theme supplies colors for both public and repository views. */
body { font-family: var(--font-sans) !important; -webkit-font-smoothing: antialiased; }
body :where(h1, h2, h3, h4, h5, h6, p, a, button, input, select, textarea, label, span, div, li, td, th, small, strong, legend, .ui, .item, .menu) { font-family: var(--font-sans) !important; }
button, input, select, textarea { font-family: var(--font-sans) !important; }
code, pre, kbd, .monospace { font-family: var(--font-mono) !important; }
#navbar { border-bottom: 1px solid var(--color-light-border); box-shadow: none; }
.ui.primary.button { background: var(--color-primary); color: var(--color-primary-contrast); }
.ui.primary.button:hover, .ui.primary.button:focus { background: var(--color-primary-dark-2); color: var(--color-primary-contrast); }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
body:has(.next-hat-home) #navbar, body:has(.next-hat-signin) #navbar,
body:has(.next-hat-home) > .page-footer { display: none; }

.next-hat-container { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: 20px; }
.next-hat-home { width: 100%; padding: 64px 0 0; margin: 0; background: var(--color-body); text-align: left; }
.next-hat-skip-link { position: fixed; top: -80px; left: 20px; z-index: 1100; padding: 12px 16px; background: var(--color-box-body); color: var(--color-text); border: 1px solid var(--color-light-border); border-radius: 8px; }
.next-hat-skip-link:focus { top: 12px; }
.next-hat-home-header { position: fixed; inset: 0 0 auto; z-index: 1000; height: 64px; border-bottom: 1px solid var(--color-light-border); background: color-mix(in srgb, var(--color-body) 75%, transparent); backdrop-filter: blur(20px); }
.next-hat-header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.next-hat-home-brand { display: inline-flex; flex-shrink: 0; align-items: center; gap: 8px; color: var(--color-text); font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.next-hat-home-brand:hover { color: var(--color-text); }
.next-hat-home-brand img { width: 32px; height: 32px; border-radius: 50%; }
.next-hat-brand-section { display: none; gap: 12px; margin-left: 4px; color: var(--color-text-light-2); font-weight: 400; }
.next-hat-header-actions, .next-hat-desktop-nav { display: flex; align-items: center; gap: 24px; }
.next-hat-desktop-nav { display: none; }
.next-hat-desktop-nav a, .next-hat-mobile-menu nav a { color: var(--color-text-light-1); font-size: 14px; }
.next-hat-desktop-nav a:hover, .next-hat-mobile-menu nav a:hover { color: var(--color-text); }
.next-hat-header-signin { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 12px; border: 1px solid var(--color-light-border); border-radius: 6px; color: var(--color-text); font-size: 14px; white-space: nowrap; }
.next-hat-header-signin:hover { background: var(--color-hover); color: var(--color-text); }
.next-hat-mobile-menu summary { width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; list-style: none; border-radius: 6px; color: var(--color-text); }
.next-hat-mobile-menu summary::-webkit-details-marker { display: none; }
.next-hat-mobile-menu summary:hover { background: var(--color-hover); }
.next-hat-mobile-menu nav { position: absolute; top: 63px; inset-inline: 0; display: flex; flex-direction: column; gap: 0; padding: 12px 20px; background: var(--color-body); border-bottom: 1px solid var(--color-light-border); box-shadow: 0 12px 24px var(--next-hat-card-shadow); }
.next-hat-mobile-menu nav a { padding: 12px 0; }

.next-hat-hero { position: relative; isolation: isolate; padding-block: 64px; background: linear-gradient(135deg, #ff98001f, #6366f11a 50%, #0000000d); }
.page-content.next-hat-home > .next-hat-hero { margin-top: 0; }
.next-hat-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: linear-gradient(var(--next-hat-grid) 1px, transparent 1px), linear-gradient(90deg, var(--next-hat-grid) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, #000, transparent); }
.next-hat-hero-grid { display: grid; align-items: center; gap: 56px; }
.next-hat-hero-copy { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 24px; }
.next-hat-eyebrow { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--color-text-light-1); font-family: var(--font-mono) !important; font-size: 11px; letter-spacing: .1em; line-height: 1.4; font-weight: 500; }
.next-hat-eyebrow::before { content: ""; width: 5px; height: 5px; background: var(--color-primary); }
.next-hat-home .next-hat-hero h1 { margin: 12px 0 8px; color: var(--color-text); font-size: clamp(48px, 5.7vw, 80px); line-height: 1.04; letter-spacing: -.055em; font-weight: 700; overflow-wrap: normal; }
.next-hat-hero h1 span { background-image: var(--next-hat-brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.next-hat-lead { margin: 0; color: var(--color-text); font-size: clamp(20px, 2vw, 24px); line-height: 1.45; letter-spacing: -.02em; }
.next-hat-description { max-width: 570px; margin: -12px 0 0; color: var(--color-text-light-1); font-size: 18px; line-height: 1.75; }
.next-hat-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.next-hat-actions .ui.button { min-height: 36px; display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 9px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; }
.next-hat-proof { margin: 0; color: var(--color-text-light-1); font-size: 13px; line-height: 1.6; }
.next-hat-preview { min-width: 0; overflow: hidden; border: 1px solid var(--color-light-border); border-radius: 12px; background: var(--color-box-body); box-shadow: 0 20px 55px var(--next-hat-card-shadow); }
.next-hat-preview-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 20px; border-bottom: 1px solid var(--color-light-border); background: var(--color-body); color: var(--color-text-light-1); font-size: 12px; }
.next-hat-preview-header > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.next-hat-preview-label { font-size: 10px; letter-spacing: .06em; }
.next-hat-preview-intro { padding: 28px 24px; }
.next-hat-home .next-hat-preview h2 { margin: 0 0 16px; color: var(--color-text); font-size: 26px; line-height: 1.25; letter-spacing: -.035em; font-weight: 600; }
.next-hat-preview-intro p { margin: 0; color: var(--color-text-light-1); font-size: 14px; line-height: 1.75; }
.next-hat-preview-steps { list-style: none; padding: 0; margin: 0; }
.next-hat-preview-steps li { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border-top: 1px solid var(--color-light-border); }
.next-hat-step-icon { flex-shrink: 0; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--color-light-border); border-radius: 8px; color: var(--color-primary); background: var(--color-body); }
.next-hat-home .next-hat-preview h3 { margin: 0 0 5px; color: var(--color-text); font-size: 14px; font-weight: 600; }
.next-hat-preview-steps p { margin: 0; color: var(--color-text-light-1); font-size: 12px; line-height: 1.6; }
.next-hat-step-number { margin-left: auto; color: var(--color-text-light-2); font-size: 11px; }
.next-hat-preview-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-top: 1px solid var(--color-light-border); color: var(--color-text); font-size: 14px; background: var(--color-body); }
.next-hat-preview-link:hover { color: var(--color-primary); }
.next-hat-workflow { padding-block: 64px; border-top: 1px solid var(--color-light-border); scroll-margin-top: 88px; }
.next-hat-section-intro { max-width: 700px; margin-bottom: 40px; }
.next-hat-home .next-hat-section-intro h2 { margin: 20px 0 16px; color: var(--color-text); font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -.045em; font-weight: 600; }
.next-hat-section-intro p:last-child { margin: 0; color: var(--color-text-light-1); font-size: 16px; line-height: 1.7; }
.next-hat-features { display: grid; gap: 32px; }
.next-hat-features article { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px 0 0; border-top: 1px solid var(--color-light-border); }
.next-hat-features article > span { color: var(--color-text-light-1); font-family: var(--font-mono) !important; font-size: 11px; letter-spacing: .06em; }
.next-hat-home .next-hat-features h3 { margin: 0; color: var(--color-text); font-size: 20px; letter-spacing: -.025em; font-weight: 600; }
.next-hat-features p { margin: 0; color: var(--color-text-light-1); line-height: 1.75; }

.next-hat-public-footer { background: var(--color-body); border-top: 1px solid var(--color-light-border); }
.next-hat-footer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; padding-block: 48px; }
.next-hat-footer-brand { grid-column: 1 / -1; }
.next-hat-footer-brand .next-hat-home-brand { font-size: 18px; gap: 12px; }
.next-hat-footer-brand p { margin: 20px 0 0; color: var(--color-text-light-1); font-size: 14px; line-height: 1.9; }
.next-hat-footer-grid nav { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.next-hat-footer-grid h2 { margin: 0 0 8px; color: var(--color-text); font-size: 14px; font-weight: 600; }
.next-hat-footer-grid nav a { padding: 4px 0; color: var(--color-text-light-1); font-size: 14px; }
.next-hat-footer-grid nav a:hover { color: var(--color-text); text-decoration: underline; text-underline-offset: 4px; }
.next-hat-footer-bottom { display: flex; flex-direction: column; gap: 12px; padding-block: 28px; border-top: 1px solid var(--color-light-border); color: var(--color-text-light-1); font-size: 12px; line-height: 1.7; }

body:has(.next-hat-signin) { background-color: var(--color-body); background-image: linear-gradient(var(--next-hat-grid) 1px, transparent 1px), linear-gradient(90deg, var(--next-hat-grid) 1px, transparent 1px), radial-gradient(circle at 10% 30%, var(--next-hat-glow-orange), transparent 35%), radial-gradient(circle at 82% 35%, var(--next-hat-glow-indigo), transparent 38%); background-size: 48px 48px, 48px 48px, 100% 100%, 100% 100%; }
.next-hat-signin { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 64px 20px 96px; }
.next-hat-signin-card { width: min(100%, 448px); padding: 34px 32px 30px; border: 1px solid var(--color-input-border); border-radius: 16px; background: var(--color-box-body); box-shadow: 0 20px 55px var(--next-hat-card-shadow); text-align: center; }
.next-hat-signin-logo { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; box-shadow: 0 1px 4px var(--next-hat-logo-shadow); }
.next-hat-signin-brand { margin: 0 0 28px; color: var(--color-text); font-size: 14px; }
.next-hat-signin-card h1 { margin: 0 0 10px; color: var(--color-text); font-size: 25px; line-height: 1.15; letter-spacing: -.04em; font-weight: 600; }
.next-hat-signin-card > p { margin: 0 0 26px; color: var(--color-text-light-1); font-size: 14px; line-height: 1.65; }
.next-hat-signin-button { display: inline-flex !important; align-items: center; gap: 8px; width: 100%; justify-content: center; min-height: 46px; border-radius: 7px; }
.next-hat-signin-note { margin: 18px 0 0 !important; color: var(--color-text-light-2) !important; font-size: 12px !important; }

@media (min-width: 640px) {
  .next-hat-container { padding-inline: 32px; }
  .next-hat-brand-section { display: inline-flex; }
  .next-hat-hero, .next-hat-workflow { padding-block: 80px; }
  .next-hat-preview-intro { padding: 32px; }
  .next-hat-preview-header, .next-hat-preview-steps li, .next-hat-preview-link { padding-inline: 32px; }
  .next-hat-footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-block: 64px; }
  .next-hat-footer-bottom { flex-direction: row; justify-content: space-between; }
}
@media (min-width: 1024px) {
  .next-hat-container { padding-inline: 48px; }
  .next-hat-desktop-nav { display: flex; }
  .next-hat-mobile-menu { display: none; }
  .next-hat-hero, .next-hat-workflow { padding-block: 96px; }
  .next-hat-hero-grid { grid-template-columns: 1.1fr 1fr; gap: 64px; }
  .next-hat-features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .next-hat-footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px; }
  .next-hat-footer-brand { grid-column: auto; }
}
@media (max-width: 390px) {
  .next-hat-header-actions { gap: 8px; }
  .next-hat-home .next-hat-hero h1 { font-size: 44px; }
  .next-hat-step-number { display: none; }
}
