/* Homepage only. Shared application and article styles are deliberately separate. */
:root {
    color-scheme: light;
    --forest: #183B2B;
    --action: #347B40;
    --action-hover: #286533;
    --page: #F4F6F0;
    --section: #EDF1E8;
    --card: #FFFFFF;
    --ink: #202A24;
    --muted: #647067;
    --line: #DCE3D8;
    --warning: #854421;
    --warning-bg: #FFF5E8;
    --radius: 24px;
    --radius-small: 16px;
    --container: 1240px;
    --gutter: 24px;
    --section-space: 64px;
    --gap: 24px;
    --h1: 56px;
    --h2: 32px;
    --shadow: 0 8px 28px rgb(24 59 43 / 5%);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.6 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--forest); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
h2 { font-size: var(--h2); letter-spacing: -.025em; }
h3 { font-size: 21px; }
a { color: var(--action); text-underline-offset: 4px; }
button, input { font: inherit; }
button, summary, label { -webkit-tap-highlight-color: transparent; }
svg { flex-shrink: 0; vertical-align: middle; }
img { max-width: 100%; display: block; }
button, summary { cursor: pointer; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 4px; }
[id] { scroll-margin-top: 24px; }
.section-shell { width: min(var(--container), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 50; background: var(--card); padding: 12px 20px; border: 1px solid var(--action); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: relative; z-index: 10; }
.header-inner { max-width: calc(var(--container) + var(--gutter) * 2); padding-inline: var(--gutter); min-height: 72px; margin: auto; display: flex; align-items: center; gap: 32px; }
.site-brand { display: flex; gap: 9px; align-items: center; color: var(--forest); font-size: 23px; letter-spacing: -.7px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.site-brand__accent { color: var(--action); }
.primary-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.primary-nav a { color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; min-height: 44px; display: flex; align-items: center; white-space: nowrap; }
.primary-nav a:hover, .primary-nav a[aria-current] { color: var(--forest); }
.primary-nav a[aria-current] { font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.lang-switch { position: relative; }
.lang-switch__current { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 60px; min-height: 44px; color: var(--forest); font-size: 14px; font-weight: 600; }
.lang-flag { display: none; }
.lang-switch__menu { list-style: none; position: absolute; right: 0; top: calc(100% + 12px); min-width: 220px; max-height: min(65vh, 480px); overflow: auto; margin: 0; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-small); box-shadow: var(--shadow); }
.lang-switch__item { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.lang-switch__item:hover, .lang-switch__item--active { background: var(--section); color: var(--forest); }
.top-bar, .top-bar__user { display: flex; align-items: center; gap: 8px; }
.top-bar { background: transparent; border: 0; position: static; padding: 0; }
.top-bar__avatar { display: none; border-radius: 50%; object-fit: cover; }
.profile-link { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; color: var(--forest); font-size: 14px; font-weight: 500; text-decoration: none; }
#pwa-install-btn { align-items: center; gap: 6px; padding: 8px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; color: var(--forest); background: var(--section); font-size: 14px; }
.mobile-nav { display: none; }
.hero { padding-block: 56px; }
.hero__content { display: grid; grid-template-columns: 1.08fr 1fr; gap: 56px; align-items: center; }
.hero__copy { min-width: 0; }
.hero__title { max-width: 620px; font-size: var(--h1); line-height: 1.1; letter-spacing: -.045em; }
.hero__subtitle { max-width: 520px; margin-top: 20px; color: var(--muted); font-size: 19px; line-height: 1.6; }
.hero__tagline { color: var(--action); margin-top: 24px; font-size: 23px; font-weight: 600; letter-spacing: -.02em; }
.upload-card { width: 100%; max-width: 520px; justify-self: end; background: var(--card); padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.upload-area { position: relative; width: 100%; padding: 28px 24px; background: var(--section); border: 1.5px dashed #B9CCB2; border-radius: var(--radius-small); text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.upload-area:hover, .upload-area:focus-within, .upload-area.drag-over { background: var(--section); border-color: var(--action); }
.upload-area.drag-over { outline: 3px solid var(--line); outline-offset: 4px; }
.upload-area__prompt { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.upload-area__icon { width: 72px; height: 72px; display: grid; place-items: center; background: var(--section); border-radius: 50%; color: var(--action); pointer-events: none; }
.upload-area__title { color: var(--forest); font-size: 20px; font-weight: 600; line-height: 1.4; pointer-events: none; }
.upload-area__or { color: var(--muted); font-size: 14px; pointer-events: none; }
.btn-upload, .btn-submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--action); color: var(--on-action, white); font-size: 16px; font-weight: 600; cursor: pointer; transition: background .15s; line-height: 1.4; }
.btn-upload:hover, .btn-submit:hover { background: var(--action-hover); }
.btn-upload:active, .btn-submit:active { background: var(--forest); }
.btn-submit:disabled { opacity: .55; cursor: wait; }
.upload-hint { font-size: 13px; color: var(--muted); }
/* The native input stays in the keyboard order; its focus is shown on the label. */
#photo-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.upload-area:has(#photo-input:focus-visible) .btn-upload { outline: 3px solid var(--action); outline-offset: 4px; }
#preview-wrap { display: none; position: relative; }
#preview-img { width: 100%; max-height: 300px; object-fit: contain; border-radius: 10px; }
.btn-clear { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: #8C302F; font-size: 28px; }
.btn-submit { margin-top: 16px; }
#upload-error { color: #9F3131; font-size: 14px; text-align: center; margin-top: 12px; }
.login-banner { display: none; text-align: center; }
.login-banner--visible { display: block; }
.login-banner__link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.social-proof { background: var(--card); border-block: 1px solid var(--line); }
.social-proof__inner { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; padding-block: 22px; color: var(--forest); }
.social-proof p { font-size: 18px; font-weight: 600; }
.social-proof__rating { display: inline-flex; align-items: center; flex-shrink: 0; gap: 8px; margin-left: 10px; padding-left: 24px; border-left: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.social-proof__rating strong { font-size: 18px; color: var(--forest); }
.social-proof__rating svg { color: #A66A16; }
.social-proof__stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.social-proof__stores .btn-store { white-space: nowrap; }
.social-proof__stores .btn-store svg { width: 18px; flex-shrink: 0; }
.how-it-works, .example-section, .popular-section, .tag-articles, .recent-posts { padding-block: var(--section-space); }
.how-it-works__title { text-align: center; margin-bottom: 32px; }
.how-it-works__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.how-it-works__step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-small); padding: 28px; }
.how-it-works__num { display: none; }
.how-it-works__icon { color: var(--action); margin-bottom: 20px; }
.how-it-works__step-title { margin-bottom: 12px; }
.how-it-works__step-text { color: var(--muted); }
.example-section { padding-top: 12px; }
.section-heading { margin-bottom: 28px; }
.section-heading > p { margin-top: 10px; color: var(--muted); }
.section-heading--row { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.text-link { font-size: 15px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.example-card { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.example-card__photo { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }
.example-card__body { padding: 32px; }
.example-card__label { color: var(--muted); font-size: 13px; }
.example-card h3 { font-size: 28px; margin-top: 10px; }
.scientific-name { color: var(--muted); font-style: italic; font-size: 14px; }
.example-card__body > p:not(.scientific-name) { margin-top: 18px; color: var(--muted); }
.example-details { margin-block: 20px 6px; }
.example-details > div { padding-block: 10px; border-top: 1px solid var(--line); }
.example-details dt { font-weight: 600; font-size: 14px; color: var(--forest); }
.example-details dd { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.example-result { margin: 20px 0 8px; padding-left: 22px; font-size: 14px; overflow-wrap: anywhere; }
.example-result > li { padding-left: 4px; margin-bottom: 12px; }
.example-result strong { color: var(--forest); }
.example-confusions summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-weight: 600; color: var(--forest); }
.example-confusions summary::after { content: '+'; font-size: 22px; font-weight: 400; }
.example-confusions[open] summary::after { content: '−'; }
.example-confusions ul { padding-left: 18px; margin: 8px 0 0; }
.example-confusions li { margin-bottom: 14px; }
.safety-note { grid-column: 1 / -1; background: var(--warning-bg); color: var(--warning); padding: 16px 24px; font-size: 14px; border-top: 1px solid #EDDAC4; }
.popular-section { padding-top: 0; }
.species-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.species-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-small); overflow: hidden; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.species-card:hover, .post-card:hover, .tag-article-card:hover { border-color: #A3B89B; box-shadow: var(--shadow); }
.species-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.species-card__body { padding: 18px; }
.species-card h3 { font-size: 18px; margin-bottom: 4px; }
.habitat-section { background: var(--section); border-block: 1px solid var(--line); }
.habitat-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; padding-block: var(--section-space); align-items: center; }
.section-icon { color: var(--action); margin-bottom: 18px; }
.habitat-layout h2 { max-width: 400px; margin-bottom: 16px; }
.habitat-layout p { color: var(--muted); }
.region-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.region-links a { display: inline-flex; align-items: center; min-height: 48px; padding: 8px 22px; border: 1px solid #BDCEB5; background: var(--card); border-radius: 10px; font-weight: 600; text-decoration: none; }
.region-links a:hover { border-color: var(--action); }
.habitat-preview { overflow: hidden; border: 1px solid #CAD5C3; border-radius: var(--radius-small); background: var(--card); }
.habitat-preview img { display: block; width: 100%; height: auto; }
.habitat-preview p { padding: 10px 16px; font-size: 13px; }
.tag-articles__track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.tag-article-card, .post-card { overflow: hidden; display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-small); text-decoration: none; }
.tag-article-card__img, .post-card__thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tag-article-card__no-img, .post-card__no-thumb { min-height: 120px; display: grid; place-items: center; color: var(--action); background: var(--section); }
.tag-article-card__body, .post-card__body { padding: 20px; }
.tag-article-card__title, .post-card__title { font-size: 18px; font-weight: 600; color: var(--forest); line-height: 1.4; }
.tag-article-card__body p { color: var(--muted); font-size: 14px; margin-top: 12px; }
.recent-posts { background: var(--section); padding-inline: max(var(--gutter), calc((100% - var(--container)) / 2)); }
.recent-posts__title { margin-bottom: 28px; }
.posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.post-card__date { font-size: 13px; color: var(--muted); margin-top: 12px; }
.faq-section { padding-top: var(--section-space); }
.faq-section h2 { margin-bottom: 28px; }
.faq-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--card); }
.faq-item + .faq-item { border-top: 1px solid var(--line); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding: 20px 24px; color: var(--forest); font-size: 17px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.faq-item summary:hover { background: var(--section); }
.faq-item summary:focus-visible { outline-offset: -4px; border-radius: 8px; }
.faq-item[open] summary svg { transform: rotate(180deg); }
.faq-item p { padding: 0 24px 24px; max-width: 1000px; color: var(--muted); font-size: 16px; overflow-wrap: anywhere; }
.app-section { margin-block: var(--section-space); display: flex; align-items: center; justify-content: center; gap: 24px; }
.app-icon { border-radius: 18px; }
.app-section__title { font-size: 24px; }
.app-rating { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.app-rating svg { color: #A66A16; }
.app-rating strong { color: var(--forest); font-size: 18px; }
.hero-stores { display: flex; margin-top: 16px; }
.hero-store-badge { max-width: 180px; display: block; }
.hero-store-badge img { width: 180px; height: auto; }
.site-footer { background: var(--card); border-top: 1px solid var(--line); padding: 48px var(--gutter) 20px; }
.footer-grid { max-width: var(--container); margin: auto; display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 40px; }
.footer-brand__logo { display: flex; align-items: center; gap: 12px; color: var(--forest); text-decoration: none; }
.footer-brand__logo img { width: 44px; height: 44px; border-radius: 10px; }
.footer-brand__name, .footer-col__title { font-size: 17px; color: var(--forest); font-weight: 600; line-height: 1.4; }
.footer-brand__desc, .footer-col__text, .footer-app__text { font-size: 14px; color: var(--muted); margin-top: 14px; }
.footer-warning { margin-top: 16px; padding: 12px; background: var(--warning-bg); color: var(--warning); border-radius: 10px; font-size: 14px; }
.footer-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.footer-stores { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn-store { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: var(--forest); text-decoration: none; }
.footer-bottom { max-width: var(--container); margin: 32px auto 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
@media (max-width: 1100px) {
    :root { --h1: 44px; }
    .header-inner { gap: 20px; }
    .primary-nav { gap: 14px; }
    .primary-nav a, .profile-link { font-size: 13px; }
    .hero__content { gap: 40px; }
    .hero__subtitle { font-size: 18px; }
    .header-actions { gap: 8px; }
    .upload-card { padding: 24px; }
}
@media (max-width: 950px) {
    .primary-nav { display: none; }
    .header-actions { margin-left: auto; }
    .mobile-nav { display: block; }
    .mobile-nav summary { width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: 8px; color: var(--forest); }
    .mobile-nav nav { position: absolute; top: 100%; left: 0; right: 0; padding: 12px var(--gutter); border-bottom: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
    .mobile-nav a { display: flex; align-items: center; min-height: 48px; text-decoration: none; }
    .species-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .habitat-layout { gap: 32px; }
    .how-it-works__step { padding: 22px; }
}
@media (max-width: 767px) {
    :root { --h1: 36px; --h2: 28px; --gutter: 20px; --section-space: 40px; --gap: 16px; }
    .header-inner { min-height: 64px; gap: 12px; }
    .site-brand { font-size: 20px; gap: 5px; }
    .site-brand > svg { width: 28px; height: 28px; }
    .header-actions { gap: 2px; }
    .profile-link { width: 44px; }
    .profile-link span, .top-bar__avatar { display: none !important; }
    #pwa-install-btn { position: absolute; top: calc(100% + 12px); right: 20px; background: var(--card); box-shadow: var(--shadow); }
    .lang-switch__current { min-width: 48px; }
    .hero { padding-block: 24px 32px; }
    .hero__content { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .hero__copy { text-align: center; }
    .hero__title { font-size: var(--h1); line-height: 1.12; max-width: 560px; margin: auto; letter-spacing: -.04em; }
    .hero__subtitle { font-size: 16px; line-height: 1.5; margin: 14px auto 0; }
    .hero__tagline { font-size: 20px; margin-top: 16px; }
    .upload-card { justify-self: center; padding: 18px; border-radius: 20px; }
    .upload-area { padding: 20px 16px; }
    .upload-area__prompt { gap: 10px; }
    .upload-area__icon { width: 52px; height: 52px; }
    .upload-area__icon svg { width: 28px; height: 28px; }
    .upload-area__title { font-size: 18px; }
    .social-proof__inner { padding-block: 18px; gap: 10px; flex-wrap: wrap; }
    .social-proof p { font-size: 15px; flex: 1; min-width: 0; }
    .social-proof svg { width: 24px; }
    .social-proof__rating { flex-basis: 100%; justify-content: center; margin-left: 0; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
    .social-proof__rating svg { width: 18px; }
    .how-it-works__steps, .example-card, .habitat-layout, .footer-grid { grid-template-columns: minmax(0, 1fr); }
    .how-it-works__title { text-align: left; margin-bottom: 24px; }
    .how-it-works__step { padding: 24px; }
    .how-it-works__icon { margin-bottom: 14px; }
    .example-section { padding-top: 0; }
    .example-card__photo { min-height: 0; height: auto; aspect-ratio: 4 / 3; }
    .example-card__body { padding: 24px; }
    .example-card h3 { font-size: 26px; }
    .safety-note { padding: 16px 20px; }
    .species-grid { gap: 12px; }
    .species-card__body { padding: 14px; }
    .species-card h3 { font-size: 16px; }
    .species-card .scientific-name { font-size: 13px; overflow-wrap: anywhere; }
    .tag-articles__track, .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tag-article-card__body, .post-card__body { padding: 16px; }
    .tag-article-card__title, .post-card__title { font-size: 16px; }
    .faq-item summary { padding: 18px; font-size: 16px; }
    .faq-item p { padding: 0 18px 20px; }
    .app-section { align-items: flex-start; gap: 16px; }
    .app-section__title { font-size: 21px; }
    .app-icon { width: 56px; height: 56px; border-radius: 14px; }
    .footer-grid { gap: 32px; }
}
@media (max-width: 380px) {
    :root { --gutter: 16px; --h1: 30px; }
    .site-brand { font-size: 18px; }
    .header-inner { gap: 4px; }
    .upload-card { padding: 14px; }
    .upload-area { padding-inline: 12px; }
    .tag-articles__track, .posts-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
