/* ==========================================================================
   Studio Wave Ghost Theme — screen.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
    /* Brand */
    --sw-red:        #E84848;
    --sw-red-hover:  #d03e3e;
    --sw-red-light:  #FEE2E2;

    /* Neutrals */
    --sw-white:      #ffffff;
    --sw-bg:         #ffffff;
    --sw-bg-hero:    #EFF6FF;   /* very light blue-tint for hero */
    --sw-bg-section: #F8FAFC;
    --sw-border:     #E5E7EB;

    /* Text */
    --sw-text:       #111827;
    --sw-text-mid:   #374151;
    --sw-text-muted: #6B7280;
    --sw-text-light: #9CA3AF;

    /* Blue */
    --sw-blue:       #3B82F6;
    --sw-blue-light: #EFF6FF;

    /* Accents */
    --sw-yellow:     #F59E0B;
    --sw-green:      #10B981;
    --sw-purple:     #8B5CF6;

    /* Layout */
    --sw-max-width:  1140px;
    --sw-gutter:     clamp(20px, 4vw, 60px);

    /* Nav */
    --sw-nav-height: 72px;

    /* Radius */
    --sw-radius-sm:  8px;
    --sw-radius:     12px;
    --sw-radius-lg:  20px;

    /* Shadows */
    --sw-shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --sw-shadow:     0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
    --sw-shadow-md:  0 8px 30px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.05);

    /* Transitions */
    --sw-ease:       cubic-bezier(.4,0,.2,1);
    --sw-duration:   220ms;
}

/* --------------------------------------------------------------------------
   1. Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--sw-text);
    background: var(--sw-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, video {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol { list-style: none; }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--sw-text);
}

/* --------------------------------------------------------------------------
   2. Viewport wrapper
   -------------------------------------------------------------------------- */
.sw-viewport {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sw-main {
    flex: 1;
}

/* --------------------------------------------------------------------------
   3. Utility / Shared
   -------------------------------------------------------------------------- */
.sw-inner,
.sw-section-inner,
.sw-posts-inner,
.sw-related-inner {
    max-width: var(--sw-max-width);
    margin-inline: auto;
    padding-inline: var(--sw-gutter);
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.sw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 26px;
    border-radius: 50px;
    font-size: .9375rem;
    font-weight: 600;
    transition: background var(--sw-duration) var(--sw-ease),
                transform 120ms var(--sw-ease),
                box-shadow var(--sw-duration) var(--sw-ease);
    white-space: nowrap;
    letter-spacing: -.01em;
}

.sw-btn-primary {
    background: var(--sw-red);
    color: var(--sw-white);
    box-shadow: 0 2px 8px rgba(232,72,72,.28);
}

.sw-btn-primary:hover,
.sw-btn-primary:focus-visible {
    background: var(--sw-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(232,72,72,.35);
}

.sw-btn-primary:active { transform: none; }

.sw-btn-outline {
    background: transparent;
    color: var(--sw-text);
    border: 2px solid var(--sw-border);
}

.sw-btn-outline:hover {
    border-color: var(--sw-text);
}

.sw-btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.sw-btn-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .9375rem;
    font-weight: 600;
    color: var(--sw-text);
    transition: color var(--sw-duration) var(--sw-ease);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: transparent;
}

.sw-btn-text:hover {
    color: var(--sw-red);
    text-decoration-color: var(--sw-red);
}

/* --------------------------------------------------------------------------
   5. Navigation
   -------------------------------------------------------------------------- */
.sw-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--sw-white);
    border-bottom: 1px solid var(--sw-border);
    height: var(--sw-nav-height);
}

.sw-nav-inner {
    max-width: var(--sw-max-width);
    margin-inline: auto;
    padding-inline: var(--sw-gutter);
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

/* Logo */
.sw-nav-logo {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--sw-text);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -.02em;
    transition: opacity var(--sw-duration) var(--sw-ease);
}

.sw-nav-logo:hover { opacity: .8; }

.sw-nav-logo img {
    height: 36px;
    width: auto;
    display: inline-block;
}

/* Menu */
.sw-nav-menu {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.sw-nav-menu .nav {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.sw-nav-menu .nav li a {
    display: block;
    padding: 8px 14px;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--sw-text-mid);
    border-radius: var(--sw-radius-sm);
    transition: color var(--sw-duration) var(--sw-ease),
                background var(--sw-duration) var(--sw-ease);
}

.sw-nav-menu .nav li a:hover,
.sw-nav-menu .nav li a[aria-current="page"] {
    color: var(--sw-text);
    background: var(--sw-bg-section);
}

/* Actions */
.sw-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Burger */
.sw-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: var(--sw-radius-sm);
    transition: background var(--sw-duration) var(--sw-ease);
}

.sw-burger:hover { background: var(--sw-bg-section); }

.sw-burger span {
    display: block;
    height: 2px;
    background: var(--sw-text);
    border-radius: 2px;
    transition: transform var(--sw-duration) var(--sw-ease),
                opacity var(--sw-duration) var(--sw-ease);
}

/* Open state */
.sw-nav.is-open .sw-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sw-nav.is-open .sw-burger span:nth-child(2) { opacity: 0; }
.sw-nav.is-open .sw-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   6. Hero Section
   -------------------------------------------------------------------------- */
.sw-hero {
    background: var(--sw-bg-hero);
    position: relative;
    overflow: hidden;
    padding: 80px 0 0;
}

.sw-hero-inner {
    max-width: var(--sw-max-width);
    margin-inline: auto;
    padding-inline: var(--sw-gutter);
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 40px;
    min-height: 500px;
    padding-bottom: 60px;
}

.sw-hero-content {
    max-width: 560px;
}

.sw-hero-title {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -.03em;
    color: var(--sw-text);
    margin-bottom: 20px;
}

.sw-hero-sub {
    font-size: clamp(.9375rem, 1.5vw, 1.0625rem);
    color: var(--sw-text-muted);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 460px;
}

.sw-hero-ctas {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Hero illustration */
.sw-hero-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sw-wave-svg {
    width: 100%;
    max-width: 520px;
    height: auto;
}

/* Decorative squiggles */
.sw-hero-deco { pointer-events: none; }

.sw-deco-waves-left {
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    opacity: .6;
}

.sw-deco-waves-right {
    position: absolute;
    right: -20px;
    bottom: 20px;
    width: 80px;
    opacity: .5;
    transform: scaleX(-1);
}

/* --------------------------------------------------------------------------
   7. Section shared styles
   -------------------------------------------------------------------------- */
.sw-section {
    padding: 80px 0;
    position: relative;
}

.sw-section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    text-align: center;
    letter-spacing: -.025em;
    margin-bottom: 48px;
}

/* --------------------------------------------------------------------------
   8. Expertise / Services
   -------------------------------------------------------------------------- */
.sw-expertise {
    background: var(--sw-white);
}

.sw-expertise-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sw-service-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 28px 24px;
    background: var(--sw-white);
    border: 1.5px solid var(--sw-border);
    border-radius: var(--sw-radius);
    transition: box-shadow var(--sw-duration) var(--sw-ease),
                transform var(--sw-duration) var(--sw-ease);
}

.sw-service-card:hover {
    box-shadow: var(--sw-shadow-md);
    transform: translateY(-2px);
}

.sw-service-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: var(--sw-radius-sm);
}

.sw-service-icon svg {
    width: 64px;
    height: 64px;
}

.sw-service-title {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -.01em;
}

.sw-service-desc {
    font-size: .9375rem;
    color: var(--sw-text-muted);
    line-height: 1.6;
}

/* Expertise section decorations */
.sw-section-deco {
    position: absolute;
    pointer-events: none;
}

.sw-deco-waves-bottom {
    bottom: -10px;
    left: 0;
    width: 140px;
    opacity: .5;
}

.sw-deco-shapes-right {
    top: 40px;
    right: 20px;
    width: 80px;
    opacity: .6;
}

.sw-deco-tri-left {
    bottom: 40px;
    left: 60px;
    width: 36px;
    opacity: .6;
}

/* --------------------------------------------------------------------------
   9. Portfolio / Featured Work
   -------------------------------------------------------------------------- */
.sw-portfolio {
    background: var(--sw-bg-section);
}

.sw-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 16px;
}

/* First card spans left column fully */
.sw-portfolio-card--featured {
    grid-column: 1;
    grid-row: 1 / 3;
}

/* Cards 2-3 stack in right column upper area */
.sw-portfolio-card:nth-child(2) { grid-column: 2; grid-row: 1; }
.sw-portfolio-card:nth-child(3) { grid-column: 3; grid-row: 1; }
.sw-portfolio-card:nth-child(4) { grid-column: 2; grid-row: 2; }
.sw-portfolio-card:nth-child(5) { grid-column: 3; grid-row: 2; }

.sw-portfolio-card {
    border-radius: var(--sw-radius);
    overflow: hidden;
    position: relative;
}

.sw-portfolio-link {
    display: block;
    position: relative;
    height: 100%;
}

.sw-portfolio-img-wrap {
    width: 100%;
    height: 100%;
    min-height: 200px;
    position: relative;
    overflow: hidden;
    background: var(--sw-border);
}

.sw-portfolio-card--featured .sw-portfolio-img-wrap {
    min-height: 440px;
}

.sw-portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms var(--sw-ease);
}

.sw-portfolio-card:hover .sw-portfolio-img {
    transform: scale(1.04);
}

.sw-portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,0) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sw-portfolio-label {
    font-size: .875rem;
    color: rgba(255,255,255,.9);
}

.sw-portfolio-label strong {
    font-weight: 600;
}

.sw-portfolio-cta {
    font-size: .8125rem;
    font-weight: 600;
    color: white;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Demo placeholder cards */
.sw-portfolio-demo { background: #dde4ec; }
.sw-demo-1 { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
.sw-demo-2 { background: linear-gradient(135deg, #2a2a3e 0%, #404060 100%); }
.sw-demo-3 { background: linear-gradient(135deg, #1e3a5f 0%, #2e5598 100%); }
.sw-demo-4 { background: linear-gradient(135deg, #3d1a4f 0%, #6b2fa0 100%); }
.sw-demo-5 { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }

.sw-portfolio-card-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-align: center;
}

.sw-portfolio-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sw-bg-hero);
}

.sw-portfolio-img-placeholder span {
    font-size: .875rem;
    color: var(--sw-text-muted);
    text-align: center;
    padding: 20px;
}

/* --------------------------------------------------------------------------
   10. Testimonials
   -------------------------------------------------------------------------- */
.sw-testimonials {
    background: var(--sw-bg-section);
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 0 0 80px;
}

.sw-testimonials-wave-top {
    line-height: 0;
    margin-bottom: 60px;
}

.sw-testimonials-wave-top svg {
    width: 100%;
    height: 80px;
    display: block;
}

.sw-testimonials-slider {
    max-width: 640px;
    margin-inline: auto;
    position: relative;
    min-height: 140px;
}

.sw-testimonial {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: fadeIn 400ms var(--sw-ease);
}

.sw-testimonial.is-active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sw-testimonial-quote {
    font-size: clamp(1rem, 2vw, 1.125rem);
    font-style: normal;
    font-weight: 400;
    line-height: 1.7;
    color: var(--sw-text-mid);
    max-width: 560px;
}

.sw-testimonial-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sw-testimonial-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sw-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sw-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sw-testimonial-name {
    font-size: .9375rem;
    font-weight: 600;
    font-style: normal;
    color: var(--sw-text);
}

/* Nav arrows */
.sw-testimonials-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
}

.sw-testimonials-prev,
.sw-testimonials-next {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--sw-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sw-text-mid);
    transition: border-color var(--sw-duration) var(--sw-ease),
                background var(--sw-duration) var(--sw-ease),
                color var(--sw-duration) var(--sw-ease);
}

.sw-testimonials-prev:hover,
.sw-testimonials-next:hover {
    border-color: var(--sw-text);
    background: var(--sw-text);
    color: var(--sw-white);
}

/* Deco shape */
.sw-testimonials-deco {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 200px;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */
.sw-footer {
    background: var(--sw-white);
    border-top: 1px solid var(--sw-border);
    padding: 60px 0 40px;
}

.sw-footer-inner {
    max-width: var(--sw-max-width);
    margin-inline: auto;
    padding-inline: var(--sw-gutter);
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.sw-footer-logo {
    display: flex;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--sw-text);
    letter-spacing: -.02em;
    margin-bottom: 12px;
    transition: opacity var(--sw-duration) var(--sw-ease);
}

.sw-footer-logo:hover { opacity: .8; }

.sw-footer-logo img {
    height: 32px;
    width: auto;
    display: inline-block;
}

.sw-footer-tagline {
    font-size: .875rem;
    color: var(--sw-text-muted);
    line-height: 1.65;
    margin-bottom: 20px;
    max-width: 280px;
}

/* Footer newsletter form */
.sw-footer-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sw-footer-email {
    flex: 1;
    min-width: 160px;
    padding: 10px 16px;
    border: 1.5px solid var(--sw-border);
    border-radius: 50px;
    font-size: .875rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--sw-duration) var(--sw-ease);
    background: var(--sw-white);
}

.sw-footer-email:focus {
    border-color: var(--sw-blue);
}

.sw-footer-email::placeholder { color: var(--sw-text-light); }

.sw-footer-form .sw-btn {
    padding: 10px 20px;
    font-size: .875rem;
}

.sw-form-error {
    font-size: .8125rem;
    color: var(--sw-red);
    width: 100%;
    margin-top: 4px;
}

/* Footer columns */
.sw-footer-col-title {
    font-size: .875rem;
    font-weight: 700;
    color: var(--sw-text);
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.sw-footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
}

.sw-footer-links li a,
.sw-footer-links .nav li a {
    font-size: .9375rem;
    color: var(--sw-text-mid);
    transition: color var(--sw-duration) var(--sw-ease);
    padding: 0;
    background: none;
    border-radius: 0;
}

.sw-footer-links li a:hover,
.sw-footer-links .nav li a:hover {
    color: var(--sw-red);
    background: none;
}

/* Override nav ul */
.sw-footer-links .nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Social icons */
.sw-footer-social {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.sw-footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sw-bg-section);
    color: var(--sw-text-mid);
    transition: background var(--sw-duration) var(--sw-ease),
                color var(--sw-duration) var(--sw-ease);
}

.sw-footer-social a:hover {
    background: var(--sw-text);
    color: var(--sw-white);
}

/* --------------------------------------------------------------------------
   12. Page headers (blog index, tag, author)
   -------------------------------------------------------------------------- */
.sw-page-header {
    background: var(--sw-bg-hero);
    padding: 60px 0;
    border-bottom: 1px solid var(--sw-border);
}

.sw-page-header-inner {
    max-width: var(--sw-max-width);
    margin-inline: auto;
    padding-inline: var(--sw-gutter);
    text-align: center;
}

.sw-page-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -.03em;
    margin-bottom: 10px;
}

.sw-page-subtitle {
    font-size: 1.0625rem;
    color: var(--sw-text-muted);
    max-width: 500px;
    margin-inline: auto;
}

.sw-page-header-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-inline: auto;
    margin-bottom: 16px;
}

.sw-author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-inline: auto;
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   13. Post grid (blog index, tag, author)
   -------------------------------------------------------------------------- */
.sw-posts-section {
    padding: 60px 0;
}

.sw-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

/* Post card */
.sw-post-card {
    background: var(--sw-white);
    border-radius: var(--sw-radius);
    border: 1.5px solid var(--sw-border);
    overflow: hidden;
    transition: box-shadow var(--sw-duration) var(--sw-ease),
                transform var(--sw-duration) var(--sw-ease);
}

.sw-post-card:hover {
    box-shadow: var(--sw-shadow-md);
    transform: translateY(-3px);
}

.sw-post-card-link { display: block; }

.sw-post-card-img-wrap {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.sw-post-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms var(--sw-ease);
}

.sw-post-card:hover .sw-post-card-img { transform: scale(1.04); }

.sw-post-card-body { padding: 20px 22px 22px; }

.sw-post-card-tag {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--sw-red);
    margin-bottom: 8px;
}

.sw-post-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.015em;
    margin-bottom: 8px;
}

.sw-post-card-excerpt {
    font-size: .9rem;
    color: var(--sw-text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sw-post-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .8125rem;
    color: var(--sw-text-light);
}

/* --------------------------------------------------------------------------
   14. Single post / page article
   -------------------------------------------------------------------------- */
.sw-single { padding: 0 0 80px; }

.sw-article-header {
    max-width: 800px;
    margin-inline: auto;
    padding: 60px var(--sw-gutter) 40px;
    text-align: center;
}

.sw-article-tag {
    display: inline-block;
    font-size: .8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--sw-red);
    margin-bottom: 16px;
    transition: opacity var(--sw-duration) var(--sw-ease);
}

.sw-article-tag:hover { opacity: .7; }

.sw-article-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 900;
    letter-spacing: -.03em;
    margin-bottom: 16px;
}

.sw-article-excerpt {
    font-size: 1.125rem;
    color: var(--sw-text-muted);
    line-height: 1.7;
    margin-bottom: 24px;
}

.sw-article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.sw-article-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sw-article-author-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.sw-article-author-name {
    font-size: .9rem;
    font-weight: 600;
    color: var(--sw-text);
}

.sw-article-date,
.sw-article-reading-time {
    font-size: .875rem;
    color: var(--sw-text-muted);
}

.sw-article-feature-image {
    max-width: 1060px;
    margin-inline: auto;
    padding-inline: var(--sw-gutter);
    margin-bottom: 48px;
}

.sw-article-feature-image img {
    width: 100%;
    border-radius: var(--sw-radius-lg);
    aspect-ratio: 16/9;
    object-fit: cover;
}

.sw-article-feature-image figcaption {
    text-align: center;
    font-size: .8125rem;
    color: var(--sw-text-muted);
    margin-top: 10px;
}

/* Article content */
.sw-article-content {
    max-width: 720px;
    margin-inline: auto;
    padding-inline: var(--sw-gutter);
}

/* Ghost content typography */
.gh-content h2, .gh-content h3, .gh-content h4 {
    margin-top: 1.8em;
    margin-bottom: .6em;
}

.gh-content p {
    margin-bottom: 1.4em;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--sw-text-mid);
}

.gh-content a {
    color: var(--sw-red);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.gh-content ul, .gh-content ol {
    padding-left: 1.5em;
    margin-bottom: 1.4em;
}

.gh-content li { margin-bottom: .4em; }

.gh-content blockquote {
    border-left: 4px solid var(--sw-red);
    padding: 16px 24px;
    margin: 2em 0;
    background: var(--sw-bg-section);
    border-radius: 0 var(--sw-radius-sm) var(--sw-radius-sm) 0;
}

.gh-content blockquote p {
    font-size: 1.125rem;
    font-style: italic;
    color: var(--sw-text);
}

.gh-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 24px;
    border-radius: var(--sw-radius);
    overflow-x: auto;
    margin-bottom: 1.4em;
    font-size: .9rem;
}

.gh-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: .875em;
}

.gh-content :not(pre) > code {
    background: var(--sw-bg-section);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--sw-red);
}

.gh-content img {
    border-radius: var(--sw-radius);
    margin-bottom: 1.4em;
}

.gh-content figure figcaption {
    text-align: center;
    font-size: .8125rem;
    color: var(--sw-text-muted);
    margin-top: 8px;
}

.sw-article-footer { padding: 32px var(--sw-gutter); max-width: 720px; margin-inline: auto; }

.sw-article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sw-tag-pill {
    display: inline-block;
    padding: 5px 14px;
    background: var(--sw-bg-section);
    border-radius: 50px;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--sw-text-mid);
    border: 1.5px solid var(--sw-border);
    transition: background var(--sw-duration) var(--sw-ease),
                border-color var(--sw-duration) var(--sw-ease);
}

.sw-tag-pill:hover {
    background: var(--sw-red-light);
    border-color: var(--sw-red);
    color: var(--sw-red);
}

/* Comments */
.sw-comments {
    max-width: 720px;
    margin-inline: auto;
    padding-inline: var(--sw-gutter);
    padding-top: 48px;
}

/* Related posts */
.sw-related {
    background: var(--sw-bg-section);
    padding: 60px 0;
}

.sw-related .sw-section-title { text-align: left; margin-bottom: 32px; }

/* Page article */
.sw-article--page .sw-article-header {
    text-align: left;
    padding-top: 40px;
}

/* --------------------------------------------------------------------------
   15. Pagination
   -------------------------------------------------------------------------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 48px;
}

.pagination .older-posts,
.pagination .newer-posts,
.pagination .page-number {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border: 1.5px solid var(--sw-border);
    border-radius: 50px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--sw-text-mid);
    transition: background var(--sw-duration) var(--sw-ease),
                border-color var(--sw-duration) var(--sw-ease),
                color var(--sw-duration) var(--sw-ease);
}

.pagination .older-posts:hover,
.pagination .newer-posts:hover {
    background: var(--sw-red);
    border-color: var(--sw-red);
    color: var(--sw-white);
}

/* --------------------------------------------------------------------------
   16. Error page
   -------------------------------------------------------------------------- */
.sw-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 60px var(--sw-gutter);
}

.sw-error-code {
    font-size: clamp(4rem, 15vw, 8rem);
    font-weight: 900;
    color: var(--sw-border);
    line-height: 1;
    margin-bottom: 8px;
}

.sw-error-msg {
    font-size: 1.125rem;
    color: var(--sw-text-muted);
    margin-bottom: 32px;
}

/* --------------------------------------------------------------------------
   17. Ghost Card Assets
   -------------------------------------------------------------------------- */
.kg-width-wide {
    max-width: 1060px;
    margin-inline: auto;
    padding-inline: var(--sw-gutter);
}

.kg-width-full {
    max-width: none;
    width: 100%;
}

.kg-image-card,
.kg-gallery-card,
.kg-video-card,
.kg-embed-card,
.kg-bookmark-card,
.kg-callout-card,
.kg-toggle-card,
.kg-header-card,
.kg-product-card {
    margin-bottom: 1.6em;
}

.kg-callout-card {
    border-radius: var(--sw-radius-sm);
    padding: 20px 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--sw-bg-section);
    border-left: 4px solid var(--sw-blue);
}

.kg-bookmark-card a {
    display: flex;
    border: 1.5px solid var(--sw-border);
    border-radius: var(--sw-radius);
    overflow: hidden;
    text-decoration: none;
    transition: box-shadow var(--sw-duration) var(--sw-ease);
}

.kg-bookmark-card a:hover {
    box-shadow: var(--sw-shadow);
}

.kg-bookmark-content { padding: 20px; flex: 1; }
.kg-bookmark-title { font-weight: 700; margin-bottom: 6px; }
.kg-bookmark-description { font-size: .875rem; color: var(--sw-text-muted); }

.kg-bookmark-thumbnail img {
    width: 160px;
    height: 100%;
    object-fit: cover;
}

/* --------------------------------------------------------------------------
   18. Responsive — Tablet 900px
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {

    .sw-hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 60px;
    }

    .sw-hero-content { max-width: 100%; }
    .sw-hero-sub { max-width: 100%; margin-inline: auto; }
    .sw-hero-ctas { justify-content: center; }

    .sw-hero-illustration { order: -1; }
    .sw-wave-svg { max-width: 340px; }

    .sw-deco-waves-left,
    .sw-deco-waves-right { display: none; }

    .sw-expertise-grid {
        grid-template-columns: 1fr;
    }

    .sw-portfolio-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sw-portfolio-card--featured {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .sw-portfolio-card:nth-child(2),
    .sw-portfolio-card:nth-child(3),
    .sw-portfolio-card:nth-child(4),
    .sw-portfolio-card:nth-child(5) {
        grid-column: auto;
        grid-row: auto;
    }

    .sw-footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .sw-footer-brand { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   19. Responsive — Mobile 640px
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {

    :root {
        --sw-gutter: 20px;
        --sw-nav-height: 64px;
    }

    /* Nav mobile */
    .sw-nav-menu {
        display: none;
        position: fixed;
        inset: var(--sw-nav-height) 0 0;
        background: var(--sw-white);
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        border-top: 1px solid var(--sw-border);
        overflow-y: auto;
        z-index: 99;
    }

    .sw-nav.is-open .sw-nav-menu {
        display: flex;
    }

    .sw-nav-menu .nav {
        flex-direction: column;
        align-items: stretch;
    }

    .sw-nav-menu .nav li a {
        padding: 12px 16px;
        font-size: 1rem;
    }

    .sw-nav-actions .sw-btn {
        display: none;
    }

    .sw-burger { display: flex; }

    /* Hero */
    .sw-hero { padding: 40px 0 0; }
    .sw-wave-svg { max-width: 280px; }

    /* Expertise */
    .sw-expertise-grid { gap: 14px; }
    .sw-service-card { flex-direction: column; }

    /* Portfolio */
    .sw-portfolio-grid {
        grid-template-columns: 1fr;
    }

    .sw-portfolio-card--featured .sw-portfolio-img-wrap {
        min-height: 260px;
    }

    .sw-portfolio-card:nth-child(n) {
        grid-column: auto;
        grid-row: auto;
    }

    /* Footer */
    .sw-footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    /* Article */
    .sw-article-header { padding-bottom: 24px; }
    .sw-article-meta { gap: 10px; }

    /* Post grid */
    .sw-posts-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   20. Focus styles (a11y)
   -------------------------------------------------------------------------- */
:focus-visible {
    outline: 3px solid var(--sw-blue);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   21. Portfolio SVG mockup sizing
   -------------------------------------------------------------------------- */
.sw-mockup-svg {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    inset: 0;
    object-fit: cover;
}

.sw-portfolio-img-wrap {
    position: relative; /* ensure absolute children work */
}

/* Lighter overlay variant (for cards where label sits at bottom without full-gradient) */
.sw-portfolio-overlay--bottom {
    background: linear-gradient(to top, rgba(0,0,0,.65) 0%, rgba(0,0,0,0) 60%);
}

/* --------------------------------------------------------------------------
   22. Avatar colour variants
   -------------------------------------------------------------------------- */
.sw-avatar-placeholder { background: var(--sw-blue); }
.sw-avatar--red    { background: #E84848; }
.sw-avatar--blue   { background: #3B82F6; }
.sw-avatar--green  { background: #10B981; }
.sw-avatar--purple { background: #8B5CF6; }
.sw-avatar--yellow { background: #F59E0B; color: #111827; }

/* --------------------------------------------------------------------------
   23. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }

    html { scroll-behavior: auto; }
}
