
/* ==========================================================================
   HRTOS International Website
   Responsive Stylesheet
   Version: 2.0
   File: assets/css/responsive.css
   ========================================================================== */


/* ==========================================================================
   1. Large Desktop
   ========================================================================== */

@media (min-width: 1440px) {
    :root {
        --container-width: 1280px;
    }

    .hero-title {
        font-size: 4.2rem;
    }

    .hero-description {
        font-size: 1.2rem;
    }

    .section {
        padding-top: 110px;
        padding-bottom: 110px;
    }
}


/* ==========================================================================
   2. Desktop and Small Laptop
   ========================================================================== */

@media (max-width: 1200px) {
    :root {
        --container-width: 100%;
    }

    .container {
        width: 100%;
        padding-left: 32px;
        padding-right: 32px;
    }

    .hero-content {
        max-width: 760px;
    }

    .hero-title {
        font-size: 3.4rem;
    }

    .features-grid,
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .architecture-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* ==========================================================================
   3. Tablet
   ========================================================================== */

@media (max-width: 992px) {
    html {
        font-size: 15px;
    }

    .container {
        padding-left: 28px;
        padding-right: 28px;
    }

    /* Header */

    .site-header {
        height: auto;
        min-height: 68px;
    }

    .header-inner {
        min-height: 68px;
        flex-wrap: wrap;
    }

    .logo {
        z-index: 1002;
    }

    .main-nav {
        gap: 20px;
    }

    .main-nav a {
        font-size: 0.9rem;
    }

    /* Hero */

    .hero {
        min-height: 560px;
        padding-top: 100px;
        padding-bottom: 100px;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-description {
        font-size: 1.05rem;
        max-width: 680px;
    }

    .page-hero {
        padding-top: 100px;
        padding-bottom: 100px;
    }

    .page-hero h1 {
        font-size: 2.8rem;
    }

    /* Sections */

    .section {
        padding-top: 80px;
        padding-bottom: 80px;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .section-description {
        max-width: 680px;
    }

    /* Grids */

    .features-grid,
    .card-grid,
    .philosophy-grid,
    .scope-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Architecture */

    .architecture-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Timeline */

    .timeline {
        max-width: 100%;
    }

    /* Footer */

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 36px;
    }
}


/* ==========================================================================
   4. Mobile Navigation
   ========================================================================== */

@media (max-width: 768px) {

    /* Header */

    .site-header {
        min-height: 64px;
    }

    .header-inner {
        min-height: 64px;
        position: relative;
    }

    .logo {
        font-size: 1.25rem;
    }

    /*
       The menu button is inserted by main.js.
       Keep the button hidden on desktop and display it on mobile.
    */

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--border-color, rgba(255,255,255,0.12));
        border-radius: 8px;
        background: transparent;
        color: var(--text-primary, #ffffff);
        cursor: pointer;
        z-index: 1003;
    }

    .menu-toggle:hover {
        background: rgba(40, 120, 229, 0.12);
        border-color: var(--primary, #2878e5);
    }

    .menu-toggle:focus-visible {
        outline: 2px solid var(--primary, #2878e5);
        outline-offset: 3px;
    }

    .menu-toggle span {
        display: block;
        width: 20px;
        height: 2px;
        margin: 2px 0;
        border-radius: 2px;
        background: currentColor;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        padding: 14px 24px 22px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg-dark, #101a2b);
        border-top: 1px solid rgba(255,255,255,0.08);
        border-bottom: 1px solid rgba(255,255,255,0.08);
        box-shadow: 0 16px 30px rgba(0,0,0,0.2);
        z-index: 1001;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav a {
        display: block;
        padding: 13px 4px;
        font-size: 0.98rem;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .main-nav a:last-child {
        border-bottom: none;
    }

    .main-nav a::after {
        display: none;
    }

    /*
       Optional menu button animation.
       main.js can add the "active" class to the button.
    */

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }


    /* Container */

    .container {
        padding-left: 22px;
        padding-right: 22px;
    }


    /* Hero */

    .hero {
        min-height: auto;
        padding-top: 90px;
        padding-bottom: 90px;
    }

    .hero-content {
        text-align: center;
    }

    .hero-title {
        font-size: 2.6rem;
        line-height: 1.15;
        letter-spacing: -0.8px;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
        font-size: 1rem;
        line-height: 1.8;
    }

    .hero-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-image {
        margin-top: 40px;
    }

    .page-hero {
        padding-top: 78px;
        padding-bottom: 78px;
    }

    .page-hero h1 {
        font-size: 2.4rem;
    }

    .page-hero p {
        font-size: 1rem;
    }


    /* Sections */

    .section {
        padding-top: 68px;
        padding-bottom: 68px;
    }

    .section-title {
        font-size: 2rem;
        line-height: 1.25;
    }

    .section-description {
        font-size: 0.98rem;
        line-height: 1.8;
    }


    /* Grids */

    .features-grid,
    .card-grid,
    .philosophy-grid,
    .scope-grid,
    .architecture-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .feature-card,
    .content-card,
    .philosophy-card,
    .scope-card {
        padding: 26px;
    }


    /* About */

    .about-statement {
        padding: 32px 24px;
    }

    .about-statement h2 {
        font-size: 1.8rem;
    }


    /* Timeline */

    .timeline {
        padding-left: 28px;
    }

    .timeline::before {
        left: 7px;
    }

    .timeline-item {
        padding-left: 24px;
    }

    .timeline-item::before {
        left: -28px;
    }

    .timeline-content {
        padding: 22px;
    }


    /* Buttons */

    .btn {
        padding: 12px 22px;
        font-size: 0.92rem;
    }

    .btn-group,
    .hero-actions {
        gap: 12px;
    }


    /* Tables */

    .table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 620px;
    }

    th,
    td {
        padding: 12px 14px;
        font-size: 0.9rem;
    }


    /* Code */

    pre {
        max-width: 100%;
        overflow-x: auto;
        font-size: 0.85rem;
        line-height: 1.65;
        -webkit-overflow-scrolling: touch;
    }

    code {
        overflow-wrap: anywhere;
    }


    /* Images */

    .content-image,
    .article-image,
    .architecture-image {
        width: 100%;
        height: auto;
    }


    /* Footer */

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 30px 20px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        text-align: left;
    }


    /* Back to top */

    .back-to-top {
        right: 18px;
        bottom: 18px;
        width: 42px;
        height: 42px;
    }
}


/* ==========================================================================
   5. Small Mobile
   ========================================================================== */

@media (max-width: 480px) {

    html {
        font-size: 14px;
    }

    .container {
        padding-left: 18px;
        padding-right: 18px;
    }


    /* Header */

    .site-header,
    .header-inner {
        min-height: 60px;
    }

    .logo {
        font-size: 1.15rem;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
    }


    /* Hero */

    .hero {
        padding-top: 76px;
        padding-bottom: 76px;
    }

    .hero-title {
        font-size: 2.15rem;
        line-height: 1.2;
    }

    .hero-description {
        font-size: 0.96rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
        text-align: center;
    }

    .page-hero {
        padding-top: 66px;
        padding-bottom: 66px;
    }

    .page-hero h1 {
        font-size: 2rem;
    }


    /* Sections */

    .section {
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-description {
        font-size: 0.94rem;
    }


    /* Cards */

    .feature-card,
    .content-card,
    .philosophy-card,
    .scope-card {
        padding: 22px;
    }

    .card-title {
        font-size: 1.2rem;
    }


    /* Statistics */

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.82rem;
    }


    /* Timeline */

    .timeline-content {
        padding: 18px;
    }

    .timeline-title {
        font-size: 1.1rem;
    }


    /* Buttons */

    .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .btn-group {
        flex-direction: column;
        align-items: stretch;
    }


    /* Footer */

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer {
        padding-top: 56px;
        padding-bottom: 28px;
    }


    /* Article */

    .article-content h2 {
        font-size: 1.55rem;
    }

    .article-content h3 {
        font-size: 1.25rem;
    }

    .article-content p {
        font-size: 0.96rem;
    }


    /* Code */

    pre {
        padding: 16px;
        font-size: 0.8rem;
    }

    .code-block {
        margin-left: -4px;
        margin-right: -4px;
    }
}


/* ==========================================================================
   6. Very Small Screens
   ========================================================================== */

@media (max-width: 360px) {

    .container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .hero-title {
        font-size: 1.9rem;
    }

    .page-hero h1 {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-nav {
        padding-left: 18px;
        padding-right: 18px;
    }
}


/* ==========================================================================
   7. Landscape Mobile
   ========================================================================== */

@media (max-width: 768px) and (orientation: landscape) {

    .hero {
        min-height: auto;
        padding-top: 55px;
        padding-bottom: 55px;
    }

    .page-hero {
        padding-top: 55px;
        padding-bottom: 55px;
    }

    .section {
        padding-top: 55px;
        padding-bottom: 55px;
    }
}


/* ==========================================================================
   8. Accessibility and Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}


/* ==========================================================================
   9. High Contrast
   ========================================================================== */

@media (prefers-contrast: more) {

    .btn,
    .feature-card,
    .content-card,
    .philosophy-card,
    .scope-card {
        border-width: 2px;
    }

    a {
        text-decoration-thickness: 2px;
    }
}


/* ==========================================================================
   End of Responsive Stylesheet
   ========================================================================== */
