/*
 * NokNok public site
 *
 * Architecture:
 * 1. Design tokens
 * 2. Type and page primitives
 * 3. Shared header, sections, cards, and buttons
 * 4. Page-specific composition
 * 5. Responsive adaptations
 *
 * Home and /wallet load only this file. Keep component appearance here;
 * page-specific rules should control placement, not redefine components.
 */

:root {
  color-scheme: dark;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --header-height: 76px;
  --section-kicker-offset: 60px;
  --page-gutter: clamp(20px, 6vw, 84px);
  --content-max: 1440px;
  --green: #00e5a8;
  --green-deep: #06483d;
  --ink: #f7fbf5;
  --ink-dark: #071112;
  --muted: #b7c4bd;
  --muted-dark: #40514b;
  --paper: #edf3ef;
  --line-light: rgba(255, 255, 255, .14);
  --line-dark: rgba(7, 17, 18, .14);
  --radius-card: 18px;
  --shadow-card: 0 20px 55px rgba(0, 0, 0, .25);
  --title-size: clamp(2.8rem, 4.5vw, 4.6rem);
  --body-size: 1.08rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow-x: clip; background: var(--ink-dark); color: var(--ink); font-family: var(--font-sans); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2300e5a8' d='M0 0h12L6 8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.warning,
[role="alert"].is-warning,
.is-warning {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
}
.warning::before,
[role="alert"].is-warning::before,
.is-warning::before {
  content: "!";
  display: inline-flex;
  flex: none;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  border: 0;
  background: currentColor;
  color: var(--ink-dark);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  font-size: .72rem;
  font-weight: 900;
  line-height: 18px;
}
.bank-lookup-message.is-warning::before { display: none; }
.warning-icon { display: inline-flex; flex: none; width: 22px; height: 22px; align-items: center; justify-content: center; margin-top: 0; color: #ffe38a; font-size: 22px; font-weight: 900; line-height: 22px; }
.warning-icon::before { content: "⚠"; }
.warning-icon::after { display: none; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; font-weight: 900; }
p { margin: 0; }
[hidden] { display: none; }

/* Shared typography */
.page-title,
.section-title {
  font-size: var(--title-size);
  font-weight: 900;
  line-height: .94;
  letter-spacing: -.045em;
}

.body-copy {
  font-size: var(--body-size);
  line-height: 1.7;
}

.eyebrow,
.section-kicker,
.card-kicker {
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .14em;
  line-height: 1;
  text-transform: uppercase;
}

/* Header */
.site-header {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 6px clamp(16px, 3vw, 44px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: var(--ink-dark);
}

.brand { display: inline-flex; align-items: center; gap: 2px; color: var(--ink); }
.brand-icon { width: 64px; height: 64px; flex: none; border-radius: 7px; object-fit: cover; }
.brand-wordmark { font-size: 2rem; font-weight: 800; line-height: 1; }
.brand-wordmark span { color: var(--green); }
.site-header nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font-weight: 800; }
.site-header nav a:hover,
.site-header nav a:focus-visible { color: var(--green); }

/* Sections: kicker placement is standardized here, once. */
.site-section {
  position: relative;
  scroll-margin-top: var(--header-height);
  padding: 104px var(--page-gutter);
}

.site-section > .section-kicker {
  position: absolute;
  top: var(--section-kicker-offset);
  left: var(--page-gutter);
  margin: 0;
}

/* Shared buttons */
.button,
.primary-button,
.text-button,
.nav-cta {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 900 .86rem/1 var(--font-sans);
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover,
.button:focus-visible,
.primary-button:hover,
.primary-button:focus-visible,
.text-button:hover,
.text-button:focus-visible,
.nav-cta:hover,
.nav-cta:focus-visible { transform: translateY(-2px); }

.primary-button { background: var(--green); color: #03120e; }
.text-button { border-color: currentColor; background: transparent; }
.nav-cta { min-height: 40px; border-color: var(--green); color: var(--ink); }
.button, .primary-button, .text-button, .nav-cta, .store-button { text-transform: capitalize; }
.nav-cta:hover, .nav-cta:focus-visible { background: var(--green); color: #000 !important; }

/* Every store button uses the same icon/text geometry. */
.store-actions,
.wallet-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }

.store-button {
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  flex: 0 0 164px;
  width: 164px;
  min-height: 58px;
  align-items: center;
  column-gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: #f6fbf8;
  color: var(--ink-dark);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease;
}

.store-button:hover,
.store-button:focus-visible { border-color: var(--green); transform: translateY(-2px); }
.store-icon { position: static; grid-column: 1; grid-row: 1 / span 2; place-self: center; width: 28px; height: 28px; }
.store-icon { object-fit: contain; fill: currentColor; }
.apple-icon { width: 30px; height: 30px; }
.store-kicker, .store-name { grid-column: 2; white-space: nowrap; }
.store-kicker { color: #2f3b3d; font-size: .7rem; font-weight: 700; line-height: 1; }
.store-name { font-size: 1rem; font-weight: 900; line-height: 1.05; }

/* Footer */
.home-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 34px;
  padding: 44px var(--page-gutter);
  border-top: 1px solid var(--line-light);
  background: var(--ink-dark);
  color: var(--muted);
}
.portfolio-attribution { justify-self: start; color: rgba(247, 251, 245, .58); font-size: .88rem; }
.portfolio-attribution a { color: #fff; text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 4px; }
.footer-tagline { font-size: .9rem; text-align: center; }
.footer-meta { display: flex; justify-content: flex-end; gap: 22px; font-size: .88rem; font-weight: 800; }
.footer-meta a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 4px; }

/* Splash */
.merchant-hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  align-items: center;
  overflow: hidden;
  padding: var(--header-height) var(--page-gutter) 72px;
  background: var(--paper) url("./assets/merchant-wallet-hero-noknok.png") right center / auto 100% no-repeat;
  color: var(--ink-dark);
}
.merchant-hero-copy { position: relative; z-index: 2; width: min(620px, 100%); transform: translateY(21px); }
.merchant-hero .eyebrow { margin-bottom: 26px; color: var(--ink-dark); }
.merchant-hero .kicker-plus { display: inline-block; font-size: 1.2em; line-height: .8; vertical-align: -0.04em; }
.merchant-hero .page-title { max-width: 10ch; }
.merchant-hero .page-title span { color: #00785d; }
.merchant-hero .hero-text { width: min(470px, 100%); margin-top: 26px; color: var(--ink-dark); }
.hero-audiences { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.hero-audiences > article { display: flex; min-height: 245px; flex-direction: column; align-items: flex-start; padding: 22px; border: 1px solid var(--line-light); border-radius: var(--radius-card); background: rgba(7, 17, 18, .92); box-shadow: 0 24px 70px rgba(0, 229, 160, .18); color: var(--ink); }
.hero-audiences .card-kicker { color: var(--green); font-size: .67rem; }
.hero-audiences h2 { margin-top: 8px; font-size: 1.2rem; line-height: 1.05; }
.hero-audiences p { margin: 10px 0 20px; color: rgba(247, 251, 245, .9); font-size: 1rem; line-height: 1.5; }
.hero-audiences .primary-button { align-self: center; margin-top: auto; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 12px 24px; width: min(520px, 100%); margin-top: 42px; font-size: .83rem; }
.hero-proof strong { color: var(--ink-dark); }

/* Wallet section */
.wallet-section {
  display: grid;
  grid-template-columns: minmax(560px, 1.15fr) minmax(390px, .85fr);
  gap: clamp(42px, 5vw, 86px);
  align-items: start;
  min-height: 840px;
  background: url("./bg.png") center / cover no-repeat;
  color: var(--ink);
}
.wallet-section > .section-kicker { color: var(--green); }
.wallet-visual { position: relative; display: grid; grid-template-columns: minmax(260px, .8fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.wallet-visual > img { z-index: 6; width: min(170%, 700px); max-height: 760px; justify-self: center; filter: drop-shadow(0 42px 48px rgba(0,0,0,.52)); transform: translate(calc(2px - 15vw), -18px) translateZ(80px) scale(1.275) rotate(-12deg) perspective(1100px) rotateY(6deg); }
.wallet-phone-glow { position: absolute; left: -4%; top: 18%; width: 48%; aspect-ratio: 1; border-radius: 50%; background: var(--green); filter: blur(105px); opacity: .14; }
.wallet-capability-stack { z-index: 5; width: calc(100% + 200px); transform: translate(-215px, 155px); }
.wallet-capabilities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line-dark); border-radius: var(--radius-card); background: var(--line-dark); gap: 1px; }
.wallet-capabilities article { min-height: 150px; padding: 25px 25px 25px 35px; background: #fff; }
.wallet-capabilities strong { display: block; color: var(--green-deep); font-size: 1.14rem; font-weight: 900; }
.wallet-capabilities span { display: block; margin-top: 10px; color: var(--muted-dark); line-height: 1.52; }
.wallet-learn-more { position: relative; z-index: 6; margin: 18px 0; }
.wallet-learn-more a { color: var(--ink); font-weight: 900; text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.wallet-copy { z-index: 6; display: flex; min-height: 500px; flex-direction: column; padding: 24px 28px; border-radius: var(--radius-card); background: rgba(0, 0, 0, .7); box-shadow: var(--shadow-card); transform: translateX(50px); }
.wallet-section > .wallet-copy { transform: translateX(35px); }
.wallet-section > .wallet-visual { left: -15px; }
.wallet-copy .section-title { color: var(--ink); text-shadow: 0 6px 32px #000; }
.wallet-copy > .body-copy { width: min(400px, 100%); margin-top: 24px; color: rgba(247, 251, 245, .94); text-shadow: 0 4px 22px #000; }
.wallet-copy .wallet-actions { margin-top: 18px; margin-bottom: 28px; }
.wallet-copy .wallet-actions { display: grid; grid-template-columns: repeat(2, 164px); }
.wallet-copy .wallet-actions .chrome-store { grid-column: 1; }
.browser-support-notice { margin-top: 14px; color: rgba(247, 251, 245, .78); font-size: .9rem; }

/* Terminal section */
.merchant-section { padding-bottom: 0; background: radial-gradient(circle at 18% 42%, rgba(0,229,168,.34), transparent 38%), radial-gradient(circle at 82% 72%, rgba(0,175,126,.16), transparent 34%), var(--paper); color: var(--ink-dark); }
.merchant-section > .section-kicker { color: #087b5d; }
.terminal-showcase { display: grid; grid-template-columns: minmax(330px, .95fr) minmax(280px, .72fr) minmax(320px, .9fr); gap: clamp(24px, 3vw, 48px); align-items: start; justify-content: center; width: min(var(--content-max), 100%); margin: 0 auto; }
.terminal-screenshot { grid-column: 1; grid-row: 1; width: 90%; margin: 0; justify-self: center; overflow: hidden; border-radius: 24px; box-shadow: var(--shadow-card); transform: translateX(-4%) rotate(-12deg) perspective(1100px) rotateY(6deg); }
.terminal-screenshot img { display: block; width: 100%; height: auto; }
.terminal-showcase-copy { position: relative; top: -50px; left: -20px; width: calc(100% + 40px); grid-column: 2; grid-row: 1; display: flex; min-height: 100%; flex-direction: column; align-self: start; justify-self: center; }
.terminal-showcase-copy .section-title { width: calc(100% + 40px); color: var(--ink-dark); text-align: center; }
.terminal-showcase-copy .section-title + .section-title { margin-top: 28px; }
.terminal-inline-downloads { justify-content: center; margin-top: auto; transform: translate(20px, -2px); }
.terminal-inline-downloads .store-button { border: 1px solid rgba(7, 17, 18, .28); box-shadow: none; }
.merchant-feature-grid { align-self: center; justify-self: center; grid-column: 3; grid-row: 1; display: grid; width: 84%; grid-template-columns: 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--line-dark); border-radius: var(--radius-card); background: var(--line-dark); transform: translateY(-50px); }
.merchant-feature-grid article { display: grid; grid-template-columns: auto 1fr; min-height: 0; column-gap: 12px; row-gap: 4px; padding: 16px 30px 16px 14px; background: #fff; }
.merchant-feature-grid .step-number { color: var(--green); font-size: 1.14rem; font-weight: 900; line-height: 1.1; }
.merchant-feature-grid h3 { color: var(--green-deep); font-size: 1.14rem; line-height: 1.1; }
.merchant-feature-grid p { grid-column: 2; color: var(--muted-dark); line-height: 1.6; }
.merchant-cta-band { display: grid; width: calc(100% + (2 * var(--page-gutter))); grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 40px; margin: 4px 0 0 calc(-1 * var(--page-gutter)); padding: clamp(24px, 3vw, 38px); overflow: hidden; background: var(--green); color: #04130f; }
.merchant-cta-band .eyebrow { color: #145a49; }
.merchant-cta-band h2 { margin-top: 10px; font-size: clamp(1.8rem, 3vw, 3rem); line-height: .95; white-space: nowrap; }
.merchant-cta-band .body-copy { max-width: 700px; margin-top: 14px; }
.dark-button { background: var(--ink-dark); color: var(--ink); }
.merchant-cta-band .dark-button:hover,
.merchant-cta-band .dark-button:focus-visible { border-color: transparent; background: var(--ink-dark); color: var(--green); }

/* Shop section */
.network-section { background: var(--paper); color: var(--ink-dark); box-shadow: 0 0 70px rgba(0, 224, 155, .32); }
.network-section .merchant-cards { filter: drop-shadow(0 0 16px rgba(0, 224, 155, .18)); }
.network-section > .section-kicker { color: var(--green-deep); }
.network-heading { display: grid; grid-template-columns: 1fr auto; gap: 60px; align-items: end; padding-top: 54px; }
.network-heading .text-button { justify-self: end; }
.merchant-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 56px; }
.network-heading, .merchant-cards { position: relative; top: -40px; }
.merchant-card { width: 85%; justify-self: center; overflow: hidden; border: 1px solid rgba(7,17,18,.1); border-radius: 22px; background: #fff; box-shadow: 0 18px 46px rgba(7,17,18,.08); cursor: pointer; transition: transform 160ms ease, border-color 160ms ease; }
.merchant-card:hover, .merchant-card:focus-within { border-color: var(--green); transform: translateY(-3px); }
.merchant-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.merchant-card:nth-child(2) img { width: calc(100% + 12px); max-width: none; margin-left: -6px; transform: scale(1.03); transform-origin: center; }
.merchant-card div { padding: 22px; }
.merchant-card .card-kicker { color: var(--green-deep); font-size: .67rem; }
.merchant-card h3 { margin-top: 8px; color: var(--ink-dark); font-size: 1.35rem; }
.merchant-card p { min-height: 52px; margin-top: 10px; color: #596560; line-height: 1.55; }
.merchant-card a { display: inline-block; margin-top: 14px; color: #087b5d; font-weight: 900; }

/* Wallet detail page */
.feature-page { position: relative; min-height: 100vh; padding: calc(var(--header-height) + 134px) var(--page-gutter) 90px; background: linear-gradient(rgba(3,12,12,.5), rgba(3,12,12,.82)), url("./bg.png") center / cover fixed no-repeat; color: var(--ink); }
.feature-page > .section-kicker { position: absolute; top: calc(var(--header-height) + var(--section-kicker-offset)); left: var(--page-gutter); color: var(--green); }
.feature-hero { width: min(820px, 100%); margin: 0 auto 64px; text-align: center; }
.feature-hero .body-copy { margin-top: 26px; color: rgba(247,251,245,.88); }
.feature-grid { display: grid; width: min(1000px, 100%); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: -24px auto 0; }
.feature-card { min-height: 190px; padding: 28px; border: 1px solid rgba(0,229,168,.28); border-radius: var(--radius-card); background: rgba(7,17,18,.9); box-shadow: var(--shadow-card); }
.feature-number { color: var(--green); font-weight: 900; letter-spacing: .12em; }
.feature-card h2 { margin-top: 12px; color: var(--ink); font-size: 1.14rem; }
.feature-card p { margin-top: 8px; color: rgba(247,251,245,.76); line-height: 1.55; }

.feature-group-title { grid-column: 1 / -1; margin: 24px 0 0; color: var(--green); font-size: .9rem; letter-spacing: .14em; text-transform: uppercase; }

@media (max-width: 1100px) {
  .wallet-section { grid-template-columns: 1fr; }
  .wallet-copy { width: min(620px, 100%); transform: none; }
  .terminal-showcase { grid-template-columns: minmax(320px, .9fr) minmax(300px, 1fr); }
  .terminal-screenshot { grid-column: 1; grid-row: 1 / span 2; width: 108%; }
  .terminal-showcase-copy { grid-column: 2; grid-row: 1; }
  .merchant-feature-grid { grid-column: 2; grid-row: 2; }
}

@media (max-width: 860px) {
  .site-header { position: absolute; }
  .site-header nav { display: none; }
  .merchant-hero { min-height: auto; padding-bottom: clamp(360px, 70vw, 580px); background-position: right bottom; background-size: 100% auto; }
  .hero-audiences { grid-template-columns: 1fr; }
  .wallet-visual { grid-template-columns: 1fr; }
  .wallet-visual > img { width: min(125%, 560px); max-height: none; transform: translate(calc(-10vw - 60px), -10px) translateZ(80px) scale(1.275) rotate(-8deg); }
  .wallet-capability-stack { width: calc(100% + 120px); transform: translate(-155px, 155px); }
  .wallet-capabilities { grid-template-columns: 1fr; }
  .terminal-showcase { grid-template-columns: 1fr; }
  .terminal-screenshot { grid-column: 1; grid-row: auto; width: min(72%, 500px); justify-self: center; transform: none; }
  .terminal-showcase-copy { grid-column: 1; grid-row: auto; }
  .merchant-feature-grid { grid-column: 1; grid-row: auto; width: 100%; }
  .merchant-cta-band { grid-template-columns: 1fr; }
  .merchant-cta-band h2 { white-space: normal; }
  .network-heading { grid-template-columns: 1fr; }
  .network-heading .text-button { justify-self: start; }
  .merchant-cards { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  :root { --section-kicker-offset: 36px; --page-gutter: 18px; }
  .brand-icon { width: 52px; height: 52px; }
  .brand-wordmark { font-size: 1.65rem; }
  .store-actions, .wallet-actions { flex-wrap: wrap; }
  .store-button { flex: 1 1 170px; width: auto; }
  .merchant-hero-copy { width: 100%; }
  .merchant-hero .page-title { font-size: clamp(2.8rem, 14vw, 4.6rem); }
  .wallet-copy { min-height: 0; padding: 22px; }
  .wallet-copy .wallet-actions { margin-top: 28px; margin-bottom: 0; }
  .merchant-cards { grid-template-columns: 1fr; }
  .home-footer { grid-template-columns: 1fr; align-items: start; }
  .footer-tagline { text-align: left; }
  .footer-meta { justify-content: flex-start; }
  .feature-grid { grid-template-columns: 1fr; }
}
