/* Application pages and the applications index (src/pages/applications.mjs). Builds on site.css tokens. */

/* ---------- Hero: full-bleed photograph, copy on the left over a scrim ---------- */
.ah {
  --fg: #eef4f0; --fg-2: #c9d8d1; --fg-3: #93a69d; --line: rgba(255, 255, 255, 0.14); --line-2: rgba(255, 255, 255, 0.3);
  --eyebrow: var(--brand-mint); --link: var(--brand-mint);
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column;
  min-height: clamp(560px, 80svh, 800px); background: var(--ink-0); color: var(--fg);
}
.ah-media { position: absolute; inset: 0; z-index: -2; }
.ah-media picture, .ah-media img { display: block; width: 100%; height: 100%; }
.ah-media img { object-fit: cover; transform-origin: 60% 50%; }
.ah::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 18, 15, 0.95) 0%, rgba(7, 18, 15, 0.82) 30%, rgba(7, 18, 15, 0.35) 62%, rgba(7, 18, 15, 0.08) 100%),
    linear-gradient(0deg, rgba(7, 18, 15, 0.92) 0%, rgba(7, 18, 15, 0) 38%),
    linear-gradient(180deg, rgba(7, 18, 15, 0.55) 0%, rgba(7, 18, 15, 0) 22%);
}
.ah-in { flex: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: end; gap: clamp(28px, 5vw, 72px); padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(36px, 5vw, 60px); }
.ah-copy .crumbs { margin-bottom: clamp(40px, 8vh, 96px); color: #a9bbb3; }
.ah-copy .crumbs a { color: #d3e0da; }
.ah-copy h1 { max-width: 17ch; margin-bottom: 20px; text-wrap: balance; }
.ah-copy .lead { max-width: 54ch; margin: 0 0 30px; color: #d3e0da; }
.ah .btn-ghost { border-color: rgba(255, 255, 255, 0.38); color: #fff; background: rgba(7, 18, 15, 0.25); backdrop-filter: blur(6px); }
.ah .btn-ghost:hover { border-color: #fff; color: #fff; }
.ah .btn-primary { background: #0f9a6c; box-shadow: 0 6px 22px rgba(15, 154, 108, 0.35); }
.ah .btn-primary:hover { background: #12b07c; }
/* Hero data card. Its base styles (once in site.css, removed with the old home hero) live here now: without them the
   label and the evidence chip ran together ("Night-break thresholdResearch targets") on a bare background. */
.float-card { z-index: 4; padding: 14px 16px; border-radius: 12px; background: rgba(12, 28, 22, 0.82); border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #eef4f0; font-size: 0.8rem; }
.float-card .fc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #a9bbb3; font-size: 0.72rem; font-weight: 600; margin-bottom: 6px; }
.float-card .fc-chip { flex: none; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.float-card .fc-val { font-size: 1.6rem; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.float-card .fc-val small { font-size: 0.72rem; font-weight: 600; color: #a9bbb3; margin-left: 4px; letter-spacing: 0; }
.float-card .fc-sub { color: #a9bbb3; margin-top: 4px; }
.ah-fc { position: relative; justify-self: end; align-self: end; width: min(300px, 100%); top: auto; left: auto; right: auto; bottom: auto; }
.ah-fc .fc-val small { display: inline; }
.ah-jump { position: relative; border-top: 1px solid rgba(255, 255, 255, 0.1); background: rgba(7, 18, 15, 0.55); backdrop-filter: blur(10px); }
.ah-jump ul { display: flex; gap: 4px 28px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.ah-jump ul::-webkit-scrollbar { display: none; }
.ah-jump a { display: inline-flex; align-items: center; min-height: 52px; white-space: nowrap; color: #b9cac2; font-size: 0.86rem; font-weight: 650; text-decoration: none; border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s; }
.ah-jump a:hover, .ah-jump a:focus-visible { color: #fff; border-bottom-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .ah-media img { animation: ah-drift 24s var(--ease) both; }
  .ah-copy > * { animation: rise 0.8s var(--ease) both; }
  .ah-copy > :nth-child(2) { animation-delay: 60ms; }
  .ah-copy > :nth-child(3) { animation-delay: 120ms; }
  .ah-copy > :nth-child(4) { animation-delay: 180ms; }
  .ah-copy > :nth-child(5) { animation-delay: 240ms; }
}
@keyframes ah-drift { from { transform: scale(1.07); } to { transform: scale(1); } }
@media (max-width: 900px) {
  .ah { min-height: 0; }
  .ah-in { grid-template-columns: 1fr; padding-top: 24px; }
  .ah-copy .crumbs { margin-bottom: 96px; }
  .ah-fc { justify-self: start; }
  .ah::before { background: linear-gradient(0deg, rgba(7, 18, 15, 0.96) 0%, rgba(7, 18, 15, 0.86) 55%, rgba(7, 18, 15, 0.35) 100%); }
}
@media (max-width: 640px) {
  .ah-fc { width: 100%; background: rgba(12, 28, 22, 0.86); }
}

/* ---------- Why light matters + research-target window ---------- */
.ah-prose p { color: var(--fg-2); }
.ah-prose p strong { color: var(--fg); }
.ah-panel { position: relative; }
.ah-panel::before { content: ''; position: absolute; inset: -40px -30px auto auto; width: 260px; height: 260px; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 90, 142, 0.22), rgba(255, 90, 142, 0)); pointer-events: none; }
.ah-panel-body { padding: 18px; }
.ah-panel .figs { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ah-panel .fig { background: #0d1d18; border-color: rgba(255, 255, 255, 0.08); }
.ah-panel .fig dt { color: #8fa59b; }
.ah-panel .fig dd { color: #fff; }
.ah-panel .fig dd small { color: #a9bbb3; }
.ah-panel .tabs { background: #0d1d18; border-color: rgba(255, 255, 255, 0.08); margin-bottom: 16px; }
.ah-panel .tabs [role='tab'] { color: #a9bbb3; }
.ah-panel .tabs [role='tab']:hover { color: #fff; }
.ah-panel .tabs [role='tab'][aria-selected='true'] { background: var(--ink-3); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.ah-panel .tabs [role='tab']:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ah-fh { margin: 4px 0 10px; font-size: 0.78rem; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand-mint); }
.ah-fh + .figs + .ah-fh { margin-top: 20px; }
.ah-crop { margin: 0 0 14px; color: #c3d2cb; font-size: 0.95rem; }
.ah-note { margin: 16px 0 0; color: #8fa59b; }
.ah-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ah-status li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: start; padding: 12px 14px; border-radius: 10px; background: #0d1d18; border: 1px solid rgba(255, 255, 255, 0.07); }
.ah-status strong { display: block; color: #fff; font-size: 0.95rem; }
.ah-status strong + span { display: block; color: #a9bbb3; font-size: 0.84rem; line-height: 1.45; margin-top: 2px; }
.ah-st-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ah-panel .tag.experimental { color: #f0c56a; }
.ah-panel .tag.weak { color: #a9bbb3; }

/* ---------- Uses of light (crop library and the crop panels of application pages) ---------- */
.tag.use { letter-spacing: 0.02em; }
.tag.use-supplemental, .tag.use-interlight, .tag.use-sole { color: #087a55; background: #e3f4eb; border-color: #c5e8d6; }
.tag.use-photoperiod { color: #8a2638; background: #f9e9ec; border-color: #efcdd4; }
.tag.use-propagation { color: #2d55c4; background: #e8eefc; border-color: #ccd8f7; }
.tag.use-research { color: #9a6008; background: #fbf1dc; border-color: #f0dcb0; }
.tag.use-none { color: #5f6c66; }
.tag.use-interlight::before { border-radius: 1px; width: 3px; height: 9px; }
.tag.use-sole::before { border-radius: 2px; }
.dark .tag.use { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.14); }
.dark .tag.use-supplemental, .dark .tag.use-interlight, .dark .tag.use-sole { color: #5fe0ad; }
.dark .tag.use-photoperiod { color: #ff8fa6; }
.dark .tag.use-propagation { color: #9db4ff; }
.dark .tag.use-research { color: #f0c56a; }
.dark .tag.use-none { color: #a9bbb3; }
.ah-note a { color: var(--brand-mint); }
@media (max-width: 560px) { .ah-status li { grid-template-columns: 1fr; } .ah-st-tags { justify-content: flex-start; } }

/* ---------- System stage: the animated drawing, copy on the calm left third ---------- */
.ah-stage { position: relative; isolation: isolate; overflow: hidden; background: #07120f; color: #eef4f0; --fg: #eef4f0; --fg-2: #c3d2cb; --eyebrow: var(--brand-mint); }
.ah-stage-media { position: absolute; inset: 0; z-index: -2; }
.ah-stage-media > picture, .ah-stage-media > picture img { display: block; width: 100%; height: 100%; }
.ah-stage-media > picture img { object-fit: cover; }
.ah-stage-media .anim-pic.is-hero { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
.ah-stage::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(7, 18, 15, 0.92) 0%, rgba(7, 18, 15, 0.7) 26%, rgba(7, 18, 15, 0) 52%); }
.ah-stage.has-photo::before { background: linear-gradient(90deg, rgba(7, 18, 15, 0.94) 0%, rgba(7, 18, 15, 0.78) 34%, rgba(7, 18, 15, 0.15) 70%); }
.ah-stage-in { display: flex; align-items: center; min-height: clamp(460px, 36vw, 640px); padding-top: clamp(56px, 7vw, 96px); padding-bottom: clamp(56px, 7vw, 96px); pointer-events: none; }
.ah-stage-copy { max-width: 31rem; pointer-events: auto; }
.ah-stage-copy .lead { margin: 18px 0 0; color: #c9d8d1; }
@media (max-width: 900px) {
  .ah-stage { display: flex; flex-direction: column-reverse; }
  .ah-stage-media { position: relative; inset: auto; z-index: 0; aspect-ratio: 2 / 1; }
  .ah-stage.has-photo .ah-stage-media { aspect-ratio: 16 / 10; }
  .ah-stage-media .anim-pic.is-hero > svg { inset: 0; width: 100%; height: 100%; transform: none; }
  .ah-stage::before { display: none; }
  .ah-stage-in { min-height: 0; padding-bottom: 28px; }
}

/* ---------- Numbered pillars (what WONE delivers; index decisions) ---------- */
.ah-pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; list-style: none; margin: 0; padding: 0; }
.ah-pillars > li { position: relative; padding: 28px 26px 26px; border-radius: 20px; background: #fff; border: 1px solid var(--line); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.section:not(.paper) .ah-pillars > li { background: #eef5f1; border-color: #dfece5; }
.ah-pillars > li:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -24px rgba(7, 18, 15, 0.4); }
.ah-pn { display: block; margin-bottom: 18px; font-size: 2.1rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--brand); font-variant-numeric: tabular-nums; }
.ah-pillars h3 { margin-bottom: 10px; }
.ah-pillars p { margin: 0; color: var(--fg-2); }
@media (max-width: 980px) { .ah-pillars { grid-template-columns: 1fr; } }

/* ---------- Decisions ---------- */
.ah-dec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.ah-dec-card { padding: 28px 28px 30px 0; border-bottom: 1px solid var(--line); }
.ah-dec-card:nth-child(2n) { padding-left: 28px; padding-right: 0; border-left: 1px solid var(--line); }
.ah-dec-card h3 { position: relative; padding-left: 20px; margin-bottom: 10px; }
.ah-dec-card h3::before { content: ''; position: absolute; left: 0; top: 0.45em; width: 8px; height: 8px; border-radius: 2px; background: linear-gradient(135deg, #ff5a8e, #e0453b); box-shadow: 0 0 10px rgba(255, 90, 142, 0.55); }
.ah-dec-card p { margin: 0; color: var(--fg-2); padding-left: 20px; }
@media (max-width: 760px) {
  .ah-dec-grid { grid-template-columns: 1fr; }
  .ah-dec-card, .ah-dec-card:nth-child(2n) { padding: 24px 0; border-left: 0; }
}

/* ---------- Measurement steps, economics ---------- */
.ah-steps { list-style: none; counter-reset: ah; margin: 0; padding: 0; display: grid; gap: 0; }
.ah-steps li { position: relative; counter-increment: ah; padding: 0 0 22px 56px; }
.ah-steps li::before { content: counter(ah, decimal-leading-zero); position: absolute; left: 0; top: -2px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--line-2); color: var(--brand); font-weight: 800; font-size: 0.82rem; }
.ah-steps li:not(:last-child)::after { content: ''; position: absolute; left: 19px; top: 40px; bottom: 2px; width: 1px; background: var(--line-2); }
.ah-steps p { margin: 6px 0 0; color: var(--fg-2); }
.ah-pays { color: var(--fg); }

/* ---------- Index: application grid tags and system drawings ---------- */
.app-card .meta { margin-bottom: 2px; }
.app-card .meta .tag::before { background: var(--accent); }
.ax-sys-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.ax-sys-grid > * { grid-column: span 2; }
.ax-sys-grid[data-n='2'] > *, .ax-sys-grid[data-n='4'] > *, .ax-sys-grid[data-n='5'] > :nth-child(n+4), .ax-sys-grid[data-n='8'] > :nth-child(n+7) { grid-column: span 3; }
.ax-sys-grid[data-n='1'] > *, .ax-sys-grid[data-n='7'] > :last-child { grid-column: span 6; }
.ax-sys-card { position: relative; display: grid; overflow: hidden; border-radius: 18px; background: var(--ink-0); border: 1px solid rgba(255, 255, 255, 0.08); color: #eef4f0; text-decoration: none; transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s; }
.ax-sys-card:hover, .ax-sys-card:focus-within { transform: translateY(-4px); border-color: rgba(66, 211, 156, 0.5); box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.8); }
.ax-sys-art { display: block; }
.ax-sys-txt { position: relative; display: grid; gap: 4px; padding: 16px 56px 18px 18px; color: #eef4f0; text-decoration: none; }
.ax-sys-txt:hover { color: #fff; }
.ax-sys-txt strong { font-size: 1.05rem; }
.ax-sys-txt span { color: #a9bbb3; font-size: 0.88rem; line-height: 1.45; }
.ax-sys-card .go { position: absolute; right: 16px; top: 50%; margin-top: -16px; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.16); transition: background-color 0.2s; }
.ax-sys-txt:hover .go, .ax-sys-txt:focus-visible .go { background: #0f9a6c; border-color: #0f9a6c; }
.ax-sys-card .go svg { width: 14px; height: 14px; }
@media (max-width: 980px) { .ax-sys-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ax-sys-grid > *, .ax-sys-grid[data-n] > * { grid-column: span 1; } .ax-sys-grid[data-n='1'] > *, .ax-sys-grid[data-n='3'] > :last-child, .ax-sys-grid[data-n='5'] > :last-child, .ax-sys-grid[data-n='7'] > :last-child { grid-column: span 2; } }
@media (max-width: 620px) { .ax-sys-grid { grid-template-columns: 1fr; } .ax-sys-grid > *, .ax-sys-grid[data-n] > * { grid-column: auto !important; } }

/* finishing pass */
.ah .btn-primary { background: #08805a; }
.ah .btn-primary:hover { background: #0a6f4f; }
/* in-page jump strip: shows that it scrolls on narrow screens */
@media (max-width: 760px) {
  .ah-jump ul { scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 32px; }
  .ah-jump li { scroll-snap-align: start; }
}
@media (max-width: 420px) { .ah-jump ul { gap: 4px 14px; } }
/* ---------- Crop library: groups, uses of light, application links ---------- */
.lib-table tbody th[scope='row'] { position: static; background: none; font-size: 0.94rem; font-weight: 700; letter-spacing: -0.005em; text-transform: none; color: var(--fg); }
.lib-table td:nth-child(2) { color: var(--fg-2); }
.lib-table td .tag { margin: 0 4px 4px 0; }
.lib-table .lib-group th { position: static; padding: 16px 16px 9px; background: var(--bg-2); color: var(--fg-2); font-size: 0.72rem; letter-spacing: 0.1em; border-top: 1px solid var(--line); }
.lib-table tbody:first-of-type .lib-group th { border-top: 0; }
.lib-group th span { margin-left: 6px; font-family: var(--mono); font-weight: 600; letter-spacing: 0; color: var(--fg-3); }
.lib-table tbody[hidden] { display: none; }
.lib-table tbody tr:last-child th { border-bottom: 0; }
.lib-app { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 650; color: var(--brand); text-decoration: none; }
.lib-app svg { flex: none; width: 13px; height: 13px; align-self: center; transition: transform 0.2s var(--ease); }
.lib-app:hover { color: var(--fg); }
.lib-app:hover svg { transform: translateX(2px); }
.lib-none { color: var(--fg-3); }
.lib-uses h2 { margin: 0 0 16px; }
.lib-uses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; margin: 0; }
.lib-use { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); }
.lib-use dt { margin: 0 0 10px; }
.lib-use dd { margin: 0; color: var(--fg-2); font-size: 0.9rem; line-height: 1.5; }
@media (min-width: 641px) {
  .lib-table { table-layout: fixed; }
  .lib-table thead th:nth-child(1) { width: 29%; }
  .lib-table thead th:nth-child(2) { width: 25%; }
  .lib-table thead th:nth-child(3) { width: 27%; }
  .lib-table thead th:nth-child(4) { width: 19%; }
}
/* crop library: one card per crop on phones, under its group heading */
@media (max-width: 640px) {
  .table-wrap:has(.lib-table) { border: 0; background: none; overflow: visible; }
  .lib-table, .lib-table tbody, .lib-table tr, .lib-table td, .lib-table th { display: block; }
  .lib-table tbody[hidden], .lib-table tr[hidden] { display: none; }
  .lib-table thead { display: none; }
  .lib-table tbody tr:not(.lib-group) { padding: 14px 16px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
  .lib-table .lib-group th { padding: 18px 2px 8px; background: none; border: 0; }
  .lib-table td, .lib-table tbody th[scope='row'] { padding: 2px 0; border: 0; }
  .lib-table tbody th[scope='row'] { font-size: 1rem; padding-bottom: 4px; }
  .lib-table td:nth-child(3) { padding: 8px 0 4px; }
  .lib-table td:nth-child(4):has(.lib-none) { display: none; }
  .lib-table td:nth-child(4) { padding-top: 6px; }
}
