/* ==========================================================================
   Turingly Overrides & Extensions
   Builds on top of style.css without modifying the base stylesheet.
   Fully refined for responsiveness (mobile, tablet, desktop).
   ========================================================================== */

/* Accent color override: Vibrant Apple Blue matching Turingly App Icon */
:root {
    --accent: #0088FF;
}

.turingly-home .status-bar,
.turingly-home .hero-text,
.turingly-home .brutal-btn,
.turingly-home .badge,
.turingly-home .section-title span,
.turingly-home .project-meta,
.turingly-home footer p,
.turingly-home footer .social-links a {
    text-transform: none;
}

body.dark-mode {
    --accent: #0088FF;
}

@media (prefers-color-scheme: dark) {
    :root:not(.light-mode) {
        --accent: #0088FF;
    }
}

/* Global overflow protection & sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    line-height: 1.5;
    word-break: normal;
    overflow-wrap: break-word;
}

p {
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
}

a {
    transition: color 0.15s;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Code & long identifier wrapping */
code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    background: rgba(0, 136, 255, 0.12);
    padding: 3px 6px;
    border: 1px solid var(--fg);
    font-size: 0.88em;
    overflow-wrap: anywhere;
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
}

/* Status Bar */
.status-bar {
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 60px;
}

.status-bar .status-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.status-bar .status-badge {
    background: var(--accent);
    color: #ffffff;
    padding: 2px 8px;
    font-size: 11px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.status-bar nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.status-bar a {
    color: var(--bg);
    text-decoration: none;
    font-weight: 900;
    transition: color 0.15s;
}

.status-bar a:hover {
    color: var(--accent);
}

/* App Header & Brand */
.app-header-brand {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.app-icon-img {
    width: 96px;
    height: 96px;
    border: var(--border-width) solid var(--fg);
    box-shadow: 6px 6px 0px 0px var(--fg);
    border-radius: 22px;
    background: #000000;
    display: block;
    object-fit: cover;
    flex-shrink: 0;
}

.hero-lead {
    font-size: clamp(15px, 2vw, 19px);
    line-height: 1.6;
    max-width: 900px;
    margin-bottom: 30px;
    font-weight: 500;
}

/* Button Row & Brutal Buttons */
.brutal-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 25px;
}

.brutal-btn {
    box-shadow: 4px 4px 0px 0px var(--fg);
    max-width: 100%;
    white-space: normal;
    text-align: center;
}

.brutal-btn:hover {
    box-shadow: 6px 6px 0px 0px var(--accent);
}

.brutal-btn.primary:hover {
    background: var(--fg) !important;
    color: var(--bg) !important;
    border-color: var(--fg) !important;
    box-shadow: 6px 6px 0px 0px var(--accent) !important;
}

/* Disabled / Inactive Brutal Buttons */
.brutal-btn.disabled,
.brutal-btn[aria-disabled="true"],
.brutal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
    background: var(--bg) !important;
    color: var(--fg) !important;
    border-style: dashed !important;
    border-color: var(--fg) !important;
    box-shadow: none !important;
    transform: none !important;
}

.brutal-btn.disabled:hover,
.brutal-btn[aria-disabled="true"]:hover {
    background: var(--bg) !important;
    color: var(--fg) !important;
    box-shadow: none !important;
    transform: none !important;
    border-color: var(--fg) !important;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    border: 2px solid var(--fg);
    margin-bottom: 12px;
    line-height: 1;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.badge.accent { 
    background: var(--accent); 
    color: #ffffff; 
    border-color: var(--fg); 
}

.badge.dark { 
    background: var(--fg); 
    color: var(--bg); 
}

/* Specification Table */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.spec-table th, 
.spec-table td {
    padding: 14px 16px;
    border: 2px solid var(--fg);
    text-align: left;
    font-size: 14px;
}

.spec-table th {
    background: var(--fg);
    color: var(--bg);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.spec-table td.label {
    font-weight: 900;
    text-transform: uppercase;
    width: 32%;
    background: rgba(0, 136, 255, 0.06);
}

/* FAQ Item */
.faq-item {
    border: var(--border-width) solid var(--fg);
    box-shadow: 6px 6px 0px 0px var(--fg);
    padding: 24px;
    margin-bottom: 24px;
    background: var(--bg);
    overflow-wrap: break-word;
}

.faq-item h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--accent);
}

.faq-item p:last-child {
    margin-bottom: 0;
}

/* Prose Sections (Privacy & Docs) */
.prose ul, .prose ol {
    margin: 0 0 1.5rem 1.75rem;
}

.prose li {
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

.prose h3 {
    margin: 2rem 0 0.8rem;
    font-size: 1.3rem;
    border-bottom: 2px dashed var(--fg);
    padding-bottom: 0.4rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablets & Small Desktops (<= 900px) */
@media (max-width: 900px) {
    body {
        padding: 16px;
    }

    .container {
        padding: 20px 0;
    }

    section {
        padding: 40px 0;
    }

    .hero-text {
        font-size: clamp(42px, 11vw, 76px) !important;
        line-height: 0.95;
        margin: 15px 0 20px 0;
        word-break: break-word;
    }

    .section-title {
        margin-bottom: 35px;
    }

    .section-title::before {
        width: 24px;
    }

    .section-title span {
        font-size: clamp(18px, 4.5vw, 28px);
        margin: 0 18px;
        white-space: normal;
        text-align: center;
    }

    .grid-3 {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 14px 18px;
        margin-bottom: 40px;
    }

    .status-bar .status-left {
        width: 100%;
        justify-content: space-between;
    }

    .status-bar nav {
        width: 100%;
        justify-content: flex-start;
        gap: 12px 18px;
        border-top: 1px dashed rgba(255, 255, 255, 0.25);
        padding-top: 10px;
    }

    .spec-table td.label {
        width: 38%;
    }

    footer {
        padding: 50px 16px;
        margin-top: 60px;
    }
}

/* Mobile Devices (<= 640px) */
@media (max-width: 640px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 10px 0;
    }

    section {
        padding: 30px 0;
    }

    .brutal-card {
        padding: 22px 16px !important;
        margin-bottom: 22px;
        box-shadow: 5px 5px 0px 0px var(--fg) !important;
    }

    .hero-text {
        font-size: clamp(34px, 12vw, 54px) !important;
        letter-spacing: -0.03em;
    }

    .app-header-brand {
        gap: 14px;
    }

    .app-icon-img {
        width: 72px;
        height: 72px;
        border-radius: 18px;
        box-shadow: 4px 4px 0px 0px var(--fg);
    }

    .section-title {
        margin-bottom: 25px;
    }

    .section-title::before {
        width: 14px;
        height: 5px;
    }

    .section-title::after {
        height: 5px;
    }

    .section-title span {
        font-size: 15px;
        margin: 0 10px;
        line-height: 1.3;
    }

    .grid-3 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .brutal-btn-row {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .brutal-btn {
        width: 100%;
        padding: 14px 18px !important;
        font-size: 13px;
    }

    /* Transform table into stacked readable cards on mobile */
    .spec-table,
    .spec-table tbody,
    .spec-table tr,
    .spec-table td {
        display: block;
        width: 100% !important;
    }

    .spec-table {
        border: none;
        margin: 15px 0;
    }

    .spec-table tr {
        margin-bottom: 14px;
        border: 2px solid var(--fg);
        background: var(--bg);
    }

    .spec-table td {
        border: none;
        padding: 10px 12px;
    }

    .spec-table td.label {
        background: var(--fg);
        color: var(--bg);
        font-size: 11px;
        letter-spacing: 0.06em;
        border-bottom: 1px solid var(--fg);
    }

    .faq-item {
        padding: 18px 14px;
        margin-bottom: 16px;
        box-shadow: 4px 4px 0px 0px var(--fg);
    }

    .faq-item h3 {
        font-size: 1rem;
    }

    .prose ul, .prose ol {
        margin-left: 1.25rem;
    }

    .status-bar nav {
        gap: 8px 14px;
    }

    .status-bar nav a {
        font-size: 11px;
    }

    footer {
        padding: 35px 14px;
        margin-top: 40px;
    }

    footer p {
        font-size: 11px;
        margin-bottom: 14px;
    }

    footer .social-links {
        margin-top: 15px;
        gap: 10px 14px;
    }

    footer .social-links a {
        font-size: 11px;
    }
}

/* Extra small devices (<= 360px) */
@media (max-width: 360px) {
    body {
        padding: 8px;
    }

    .brutal-card {
        padding: 18px 12px !important;
    }

    .hero-text {
        font-size: 30px !important;
    }

    .status-bar {
        padding: 10px 12px;
    }
}
