.hero {
    text-align: center;
    padding: clamp(3rem, 6vw, 4.5rem) 1.5rem 3.5rem;
    background: linear-gradient(135deg, rgba(74, 55, 40, 0.72) 0%, rgba(217, 117, 52, 0.46) 100%), url('../images/bernedoodle_meadow.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.hero h1,
.hero p {
    text-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="white" opacity="0.1"/><circle cx="80" cy="40" r="3" fill="white" opacity="0.1"/><circle cx="40" cy="80" r="2" fill="white" opacity="0.1"/><circle cx="90" cy="70" r="2.5" fill="white" opacity="0.1"/></svg>');
    background-size: 200px 200px;
    opacity: 0.35;
}
.hero .container {
    position: relative;
    z-index: 1;
}
.hero h1 {
    font-size: clamp(2.25rem, 6vw, 3.35rem);
    margin-bottom: 0.9rem;
    font-weight: 700;
}
.hero p {
    font-size: 1.15rem;
    max-width: 60ch;
    margin: 0 auto 2rem;
    opacity: 0.95;
}
.featured-breeds {
    background: var(--surface);
    padding: clamp(3rem, 6vw, 4rem) 0;
}

.featured-breeds h2 {
    margin-bottom: 3rem;
}

.breed-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.breed-photo-card {
    --card-bg: var(--surface);
    --photo-bg: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    --title-color: var(--link);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
    backdrop-filter: hue-rotate(0deg);
}

.skip-to-content {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--primary);
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    transition: left 0.2s ease;
    z-index: 1000;
}

.skip-to-content:focus {
    left: 1rem;
}

.breed-photo-card:hover,
.breed-photo-card:focus {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.breed-photo {
    width: 100%;
    height: 220px;
    position: relative;
    background: var(--photo-bg);
    overflow: hidden;
}

.breed-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.breed-photo::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.2), transparent);
}

.breed-photo-info {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.86);
}

.breed-photo-info h3 {
    color: var(--title-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.breed-photo-info p {
    color: var(--muted);
    font-size: 0.95rem;
}

.breed-photo-card[data-theme="sunshine"] {
    --card-bg: linear-gradient(135deg, #fdf5dd 0%, #f7e2ae 100%);
    --photo-bg: linear-gradient(135deg, #fff4c7 0%, #f3c366 100%);
    --title-color: #b88616;
}

.breed-photo-card[data-theme="amber"] {
    --card-bg: linear-gradient(135deg, #fde8d1 0%, #f9c89a 100%);
    --photo-bg: linear-gradient(135deg, #fdd8b5 0%, #f79d62 100%);
    --title-color: #b5621f;
}

.breed-photo-card[data-theme="forest"] {
    --card-bg: linear-gradient(135deg, rgba(163, 177, 138, 0.55) 0%, rgba(88, 129, 87, 0.65) 100%);
    --photo-bg: linear-gradient(135deg, rgba(52, 74, 65, 0.28) 0%, rgba(163, 177, 138, 0.48) 100%), url('../images/bernedoodle_meadow.webp');
    --title-color: #2f4f31;
}

.breed-photo-card[data-theme="forest"] .breed-photo {
    background-size: cover;
    background-position: center;
}

.breed-photo-card[data-theme="rose"] {
    --card-bg: linear-gradient(135deg, #fde3ed 0%, #f9b4d0 100%);
    --photo-bg: linear-gradient(135deg, #fcd4e8 0%, #f38cb8 100%);
    --title-color: #b24578;
}

.breed-photo-card[data-theme="sky"] {
    --card-bg: linear-gradient(135deg, #e1f1fb 0%, #b9dff5 100%);
    --photo-bg: linear-gradient(135deg, #d1e7f9 0%, #6fb0dd 100%);
    --title-color: #3a6fa3;
}

.breed-photo-card[data-theme="copper"] {
    --card-bg: linear-gradient(135deg, #ffe5d6 0%, #ffc6a8 100%);
    --photo-bg: linear-gradient(135deg, #ffd8be 0%, #ff9f6e 100%);
    --title-color: #bb5a2a;
}

.search-card {
    margin: 3rem 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(230, 236, 223, 0.96) 100%);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: clamp(1.75rem, 3vw, 2.85rem);
    box-shadow: 0 26px 52px -32px rgba(52, 74, 65, 0.22);
}
.search-card h2 {
    margin-top: 0;
    font-size: 1.75rem;
}
.search-controls {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0 2rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.search-controls input,
.search-controls select {
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.85rem 1.15rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--surface-alt);
}
.search-controls input:focus,
.search-controls select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 129, 87, 0.28);
}
.search-results {
    display: grid;
    gap: 1.5rem;
}
.characteristics-table {
    margin: 3rem 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(232, 236, 223, 0.97) 100%);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    box-shadow: 0 22px 50px -34px rgba(52, 74, 65, 0.2);
    padding: clamp(1.75rem, 3vw, 2.75rem);
}
.table-scroll {
    overflow-x: auto;
}
.characteristics-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
}
.characteristics-table th,
.characteristics-table td {
    text-align: left;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}
.characteristics-table thead th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-fern-ink);
    background: rgba(163, 177, 138, 0.28);
}
.characteristics-table tbody tr:last-child td {
    border-bottom: none;
}
.table-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.table-subtext {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.75rem;
}
.characteristics-table .pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: rgba(163, 177, 138, 0.25);
    border: 1px solid rgba(88, 129, 87, 0.25);
    font-size: 0.8rem;
    color: var(--color-fern-ink);
    margin: 0.15rem 0.35rem 0.15rem 0;
}
.quiz-card,
.comparison-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(234, 238, 226, 0.97) 100%);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: clamp(1.75rem, 3vw, 2.5rem);
    box-shadow: var(--shadow-lg);
}
.quiz-question {
    margin-bottom: 1.75rem;
}
.quiz-question h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}
.quiz-options {
    display: grid;
    gap: 0.85rem;
}
.quiz-option {
    padding: 1rem 1.15rem;
    border-radius: 0.85rem;
    border: 2px solid var(--border);
    background: var(--surface-alt);
    cursor: pointer;
    transition: background 0.2s ease, border 0.2s ease, transform 0.2s ease;
}
.quiz-option:hover,
.quiz-option:focus {
    border-color: var(--accent);
    background: rgba(163, 177, 138, 0.22);
}
.quiz-option.selected {
    border-color: var(--accent);
    background: var(--accent-dark);
    color: #fff;
    transform: translateY(-1px);
}
.quiz-results {
    background: var(--surface-alt);
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid var(--border);
}
.quiz-results h3 {
    color: var(--color-fern);
    margin-bottom: 1.25rem;
}
.recommended-breed {
    background: #fff;
    border-radius: 0.85rem;
    padding: 1.5rem;
    border-left: 4px solid var(--accent);
    box-shadow: 0 18px 32px -24px rgba(52, 74, 65, 0.2);
    margin-bottom: 1.25rem;
}
.comparison-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}
.comparison-selector label {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: border 0.2s ease, background 0.2s ease;
}
.comparison-selector input[type="checkbox"] {
    accent-color: var(--accent);
}
.comparison-selector label:hover {
    border-color: var(--accent);
    background: rgba(163, 177, 138, 0.22);
}
.comparison-table {
    overflow-x: auto;
    border-radius: 1rem;
    border: 1px solid var(--border);
    background: #fff;
}
.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}
.comparison-table th,
.comparison-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.comparison-table th {
    background: var(--surface-alt);
    font-weight: 700;
}
.comparison-table tbody tr:last-child td {
    border-bottom: none;
}
.hidden {
    display: none !important;
}
.breed-card {
    --card-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(244, 246, 238, 0.95) 100%);
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2.25rem;
    padding: 1.25rem 2rem 1.25rem 0.25rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--card-bg);
    box-shadow: 0 18px 40px -28px rgba(52, 74, 65, 0.35);
    align-items: start;
}
.breed-card:nth-of-type(4n + 1) {
    --card-bg: linear-gradient(135deg, rgba(253, 245, 221, 0.9) 0%, rgba(248, 225, 188, 0.95) 100%);
}
.breed-card:nth-of-type(4n + 2) {
    --card-bg: linear-gradient(135deg, rgba(226, 241, 227, 0.92) 0%, rgba(198, 220, 200, 0.98) 100%);
}
.breed-card:nth-of-type(4n + 3) {
    --card-bg: linear-gradient(135deg, rgba(229, 240, 248, 0.9) 0%, rgba(190, 216, 237, 0.95) 100%);
}
.breed-card:nth-of-type(4n) {
    --card-bg: linear-gradient(135deg, rgba(247, 225, 233, 0.92) 0%, rgba(232, 193, 206, 0.96) 100%);
}
.breed-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 0.9rem;
    overflow: hidden;
    background: rgba(163, 177, 138, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(52, 74, 65, 0.08);
}
.breed-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.breed-card__content {
    display: grid;
    gap: 0.65rem;
    margin-left: 1.25rem;
}
.breed-card h3 {
    margin: 0;
    color: var(--color-fern-ink);
}
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(88, 129, 87, 0.28);
    background: rgba(163, 177, 138, 0.25);
    color: var(--color-fern-ink);
    font-weight: 600;
    letter-spacing: 0.01em;
}
.quick-facts {
    padding: 3rem 0;
}
.quick-facts h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
}
.fact-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.fact {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(227, 232, 220, 0.96) 100%);
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1.25rem;
}
.fact h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}
.intro-section {
    padding: 2rem 0 3rem;
}
.intro-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: start;
}
.intro-grid article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
}
.breed-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 900;
}

.breed-modal.is-visible {
    opacity: 1;
    visibility: visible;
}

.breed-modal__overlay {
    position: absolute;
    inset: 0;
}

.breed-modal__content {
    position: relative;
    max-width: 540px;
    width: min(540px, 94vw);
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 40px 70px -30px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s ease;
    max-height: min(90vh, 720px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.breed-modal.is-visible .breed-modal__content {
    transform: translateY(0) scale(1);
}

.breed-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    background: transparent;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.breed-modal__close:hover,
.breed-modal__close:focus {
    color: var(--link);
}

.breed-modal__media {
    height: clamp(180px, 32vh, 240px);
    background: var(--surface-alt);
    overflow: hidden;
}

.breed-modal__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.breed-modal__body {
    padding: 1.75rem;
    display: grid;
    gap: 1rem;
}

.breed-modal__title {
    margin: 0;
    font-size: 1.65rem;
    color: var(--text);
}

.breed-modal__subtitle {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0;
}

.breed-modal__summary {
    font-size: 0.98rem;
    color: var(--text);
    margin: 0.5rem 0 0;
}

.breed-modal__stats {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.breed-modal__stat {
    background: var(--surface-alt);
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
}

.breed-modal__stat dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.breed-modal__stat dd {
    margin: 0;
    font-weight: 600;
    color: var(--text);
}

.breed-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.breed-modal__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    background: var(--accent-dark);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 18px 32px -20px rgba(52, 74, 65, 0.32);
}

.breed-modal__link:hover,
.breed-modal__link:focus {
    transform: translateY(-2px);
    box-shadow: 0 22px 42px -24px rgba(52, 74, 65, 0.36);
}

.breed-modal__dismiss {
    background: transparent;
    border: none;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
    padding: 0.75rem 1rem;
}

.breed-modal__dismiss:hover,
.breed-modal__dismiss:focus {
    color: var(--link);
}
