@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Logo entrance + continuous "flag in the wind" animation */
@keyframes logo-entrance {
    from {
        opacity: 0;
        transform: scale(0.85) rotate(-6deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes logo-wave {

    0%,
    100% {
        transform: rotate(0deg) skewX(0deg);
    }

    25% {
        transform: rotate(-2deg) skewX(-1.5deg);
    }

    75% {
        transform: rotate(2deg) skewX(1.5deg);
    }
}

.logo-animate {
    transform-origin: left center;
    animation:
        logo-entrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) both,
        logo-wave 3.5s ease-in-out 0.7s infinite;
}

@media (prefers-reduced-motion: reduce) {
    .logo-animate {
        animation: none;
    }
}

:root {
    --color-navy: #0f172a;
    --color-navy-light: #1e293b;
    --color-accent: #f59e0b;
    /* amber-500 */
    --color-accent-hover: #d97706;
    /* amber-600 */
    --color-text: #334155;
    --color-text-light: #64748b;
    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;
    --shadow-soft: 0 24px 70px rgba(15, 23, 42, 0.12);
    --shadow-card: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(245, 158, 11, 0.26);
    color: var(--color-navy);
}

a,
button,
summary {
    -webkit-tap-highlight-color: transparent;
}

a {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

button,
[type="button"],
[type="submit"] {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(245, 158, 11, 0.55);
    outline-offset: 3px;
}

img {
    max-width: 100%;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-navy);
    line-height: 1.2;
    font-weight: 700;
}

/* Navigation */
.nav-link {
    position: relative;
    color: var(--color-navy);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--color-accent);
    transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-accent);
    color: var(--color-navy);
    font-weight: 600;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(245, 158, 11, 0.22);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    color: var(--color-navy);
    font-weight: 600;
    border-radius: 0.375rem;
    text-decoration: none;
    border: 2px solid var(--color-navy);
    transition: background-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
    background-color: var(--color-navy);
    color: #ffffff;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

main section {
    scroll-margin-top: 6.5rem;
}

main article,
main details,
main form,
main aside {
    overflow-wrap: anywhere;
}

main article img {
    display: block;
}

main article[class*="border"],
main details[class*="border"],
main form[class*="shadow"],
main aside[class*="shadow"],
main div[class*="shadow-sm"] {
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.07);
}

main article[class*="hover:-translate-y-1"]:hover,
main a[class*="hover:-translate-y-1"]:hover {
    box-shadow: var(--shadow-soft);
}

details summary::-webkit-details-marker {
    display: none;
}

/* Mobile menu */
.mobile-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.mobile-menu.open {
    display: flex;
}

/* Form styles */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-navy);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

input,
select,
textarea {
    font: inherit;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-navy);
}

/* Article typography */
.article-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.article-content p {
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--color-text);
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.article-content h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-navy);
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 1.5rem 0;
}

.article-content a {
    color: #d97706;
    text-decoration: underline;
}

.article-content blockquote {
    margin: 1.5rem 0;
    padding-left: 1.25rem;
    border-left: 4px solid #f59e0b;
    font-style: italic;
    color: #475569;
}

.article-content figcaption {
    margin-top: -1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
}

/* Utilities */
.text-balance {
    text-wrap: balance;
}

/* Responsive masonry-like grid for blog */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    body {
        overflow-x: hidden;
    }

    h1,
    h2 {
        text-wrap: balance;
    }

    main section {
        scroll-margin-top: 5.75rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
