/* pages.css — shared design system for blog, contact, legal, article pages */

:root {
    --terracotta: #E85D3A;
    --terracotta-dark: #D04E2E;
    --terracotta-deeper: #B8432A;
    --terracotta-light: #F07A5C;
    --terracotta-pale: #FBEAE5;
    --white: #ffffff;
    --white-90: rgba(255,255,255,0.9);
    --white-70: rgba(255,255,255,0.7);
    --white-50: rgba(255,255,255,0.5);
    --white-20: rgba(255,255,255,0.2);
    --white-10: rgba(255,255,255,0.1);
    --ink: #2d2420;
    --ink-light: #5c4a42;
    --ink-muted: #8a7568;
    --paper: #faf8f6;
    --border: #e8ddd6;
    --shadow: rgba(232, 93, 58, 0.08);
    --font-main: 'Outfit', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.72;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 3.5rem;
}

/* Sticky nav */

.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: var(--white);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}
.site-nav.visible {
    transform: translateY(0);
}
.site-nav-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-nav-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--terracotta);
    text-decoration: none;
}
.site-nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.site-nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-light);
    text-decoration: none;
    transition: color 0.2s;
}
.site-nav-links a:hover {
    color: var(--terracotta);
}
.site-nav-lang {
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.78rem !important;
    color: var(--ink-muted) !important;
}
.site-nav-lang:hover {
    border-color: var(--terracotta);
    color: var(--terracotta) !important;
}
.site-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.site-nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Page hero — terracotta header with elliptic wave */

.page-hero {
    background: var(--terracotta);
    color: var(--white);
    padding: 5rem 2rem 4.5rem;
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 80% 20%, rgba(255,255,255,0.06), transparent),
        radial-gradient(ellipse 80% 50% at 10% 90%, rgba(0,0,0,0.1), transparent);
    pointer-events: none;
}
.page-hero::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 80px;
    background: var(--paper);
    clip-path: ellipse(55% 100% at 50% 100%);
}
.page-hero-inner {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.page-hero h1 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.page-hero-back {
    position: absolute;
    top: 1.5rem; left: 2rem; z-index: 2;
    color: var(--white-70);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
    border-bottom: none;
}
.page-hero-back:hover {
    color: var(--white);
    border-bottom: none;
}
.page-hero-lang {
    position: absolute;
    top: 1.5rem; right: 2rem; z-index: 2;
    padding: 3px 6px;
    background: transparent;
    border: 1px solid var(--white-50);
    color: var(--white-90);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}
.page-hero-lang:hover {
    background: var(--white);
    color: var(--terracotta);
    border-bottom: none;
}

/* Home hero — photo background with elliptic wave */

.home-hero {
    background: url('/img/background.jpg') center 40% / cover no-repeat;
    color: var(--white);
    padding: 4rem 2rem 5rem;
    position: relative;
    overflow: hidden;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}
.home-hero::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 80px;
    background: var(--paper);
    clip-path: ellipse(55% 100% at 50% 100%);
}
.home-hero .page-hero-inner {
    text-align: center;
}
.home-hero-line {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.home-hero-line + .home-hero-sub {
    margin-top: 0.6rem;
    font-size: clamp(1rem, 2.2vw, 1.4rem);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.85;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.home-hero-tagline {
    margin-top: 1.2rem;
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    font-weight: 300;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}
.home-hero-cta {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    background: var(--terracotta);
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-main);
    border: none;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.3s ease;
}
.home-hero-cta:hover {
    background: var(--terracotta-dark);
    border-bottom: none;
}

/* Home — About section */

.home-about {
    margin-bottom: 3rem;
}
.home-about-text {
    font-size: 0.95rem;
    color: var(--ink-light);
    line-height: 1.72;
    margin-bottom: 1rem;
}
.home-about-link {
    color: var(--terracotta);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.home-about-link:hover {
    border-bottom-color: var(--terracotta);
}

/* Home — Services section */

.home-services {
    margin-bottom: 3rem;
}
.home-services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}
.home-service-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.3s ease;
}
.home-service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}
.home-service-icon {
    color: var(--terracotta);
    width: 48px;
    height: 48px;
    padding: 10px;
    background: var(--terracotta-pale);
    border-radius: 12px;
    margin-bottom: 1rem;
}
.home-service-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.5rem;
}
.home-service-desc {
    font-size: 0.88rem;
    color: var(--ink-muted);
    line-height: 1.55;
}

/* Home — Stats section */

.home-stats {
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--terracotta-pale);
    border-radius: 12px;
}
.home-stats .home-section-title {
    margin-bottom: 1.5rem;
}
.home-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}
.home-stat {
    text-align: center;
}
.home-stat-value {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--terracotta);
    line-height: 1.1;
    margin-bottom: 0.4rem;
}
.home-stat-label {
    display: block;
    font-size: 0.82rem;
    color: var(--ink-muted);
    line-height: 1.4;
}

/* Home — Projects section */

.home-projects {
    margin-bottom: 3rem;
}
.home-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}
.home-project-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}
.home-project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}
.home-project-period {
    font-size: 0.78rem;
    color: var(--ink-muted);
    margin-bottom: 0.4rem;
}
.home-project-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.6rem;
}
.home-project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}
.home-project-tag {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--terracotta);
    background: var(--terracotta-pale);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.home-project-desc {
    font-size: 0.88rem;
    color: var(--ink-muted);
    line-height: 1.55;
    flex: 1;
}
.home-project-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.home-project-link {
    display: inline-block;
    color: var(--terracotta);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.home-project-link:hover {
    border-bottom-color: var(--terracotta);
}

/* Home sections */

.home-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--terracotta-dark);
    margin-bottom: 1.5rem;
}
.home-articles-footer {
    margin-top: 1.5rem;
}
.home-articles-link {
    color: var(--terracotta);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    border-bottom: 1px solid transparent;
}
.home-articles-link:hover {
    border-bottom-color: var(--terracotta);
}

/* Page content — readable column */

.page-content {
    max-width: 780px;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
}
.page-content h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--terracotta-dark);
    margin: 2.5rem 0 1rem;
}
.page-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--terracotta-dark);
    margin: 2.5rem 0 0.8rem;
    padding-top: 1.5rem;
    position: relative;
}
.page-content h2::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 48px; height: 3px;
    background: var(--terracotta);
    border-radius: 2px;
}
.page-content h2:first-of-type { padding-top: 0; margin-top: 0; }
.page-content h2:first-of-type::before { display: none; }
.page-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
    margin: 1.5rem 0 0.5rem;
}
.page-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-light);
    margin: 1.2rem 0 0.4rem;
}
.page-content p {
    margin-bottom: 1rem;
}
.page-content ul,
.page-content ol {
    margin: 0.8rem 0 1rem;
    padding-left: 1.5rem;
}
.page-content li {
    margin-bottom: 0.3rem;
}
.page-content a {
    color: var(--terracotta);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.page-content a:hover {
    border-bottom-color: var(--terracotta);
}
.page-content strong {
    font-weight: 600;
}

/* Article cards */

.article-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.article-card {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}
.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
    border-bottom: none;
}
.article-card-thumb {
    width: 240px;
    object-fit: contain;
    flex-shrink: 0;
    background: var(--white);
    padding: 0.8rem;
    border-right: 1px solid var(--border);
}
.article-card-body {
    padding: 1.5rem 1.5rem 1.5rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.article-card:not(:has(.article-card-thumb)) .article-card-body {
    padding-left: 1.5rem;
}
.article-card-tags {
    font-size: 0.72rem;
    color: var(--terracotta);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}
.article-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: var(--ink);
}
.article-card-desc {
    font-size: 0.9rem;
    color: var(--ink-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.article-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--ink-muted);
}
.article-card-read {
    font-weight: 500;
    color: var(--terracotta);
}

/* Contact form — paper background variant */

.contact-form {
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--shadow);
}

.contact-presentation {
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
    color: var(--ink-light);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.contact-input,
.contact-textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--ink);
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    box-sizing: border-box;
}
.contact-textarea {
    min-height: 150px;
    resize: vertical;
}
.contact-input:focus,
.contact-textarea:focus {
    outline: none;
    border-color: var(--terracotta);
    box-shadow: 0 0 0 3px var(--terracotta-pale);
}
.contact-input::placeholder,
.contact-textarea::placeholder {
    color: var(--ink-muted);
}

.contact-button {
    width: 100%;
    padding: 0.9rem;
    background: var(--terracotta);
    border: none;
    border-radius: 6px;
    color: var(--white);
    font-size: 1rem;
    font-family: var(--font-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}
.contact-button:hover {
    background: var(--terracotta-dark);
}

.btn-sending { display: none; }
form.htmx-request .btn-send { display: none; }
form.htmx-request .btn-sending { display: inline; }
form.htmx-request .contact-button { pointer-events: none; opacity: 0.7; }

.contact-success-message,
.contact-error-message {
    margin-top: 1rem;
    padding: 0.8rem;
    text-align: center;
    border-radius: 6px;
    font-size: 0.9rem;
}
.contact-success-message {
    background: #eef7ee;
    color: #2e7d32;
}
.contact-error-message {
    background: #fdecea;
    color: #c62828;
}

.contact-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    pointer-events: none;
}

/* Home contact section */

.home-contact {
    background: var(--paper);
    padding: 4rem 2rem;
}
.home-contact-inner {
    max-width: 780px;
    margin: 0 auto;
}
.home-contact-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--terracotta-dark);
    margin-bottom: 0.5rem;
}
.home-contact-sub {
    font-size: 0.95rem;
    color: var(--ink-muted);
    margin-bottom: 2rem;
}
.home-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}
.home-contact-form .contact-input,
.home-contact-form .contact-textarea {
    background: var(--white);
}
.home-contact-form .contact-textarea {
    min-height: 120px;
}
.home-contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding-top: 0.5rem;
}
.home-contact-info-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.92rem;
    color: var(--ink-light);
}
.home-contact-info-item svg {
    color: var(--terracotta);
    flex-shrink: 0;
}
.home-contact-info-item a {
    color: var(--terracotta);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.home-contact-info-item a:hover {
    border-bottom-color: var(--terracotta);
}
.home-contact-available {
    margin-top: 0.5rem;
    font-weight: 500;
    color: #2e7d32;
}
.home-contact-dot {
    width: 10px;
    height: 10px;
    background: #4caf50;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(76,175,80,0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(76,175,80,0); }
}

/* Home footer — enriched */

.home-footer {
    background: var(--terracotta-dark);
    color: var(--white);
    padding: 0;
}
.home-footer-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}
.home-footer-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
}
.home-footer-tagline {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--white-70);
}
.home-footer-heading {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--white-70);
    margin-bottom: 0.8rem;
}
.home-footer-col {
    display: flex;
    flex-direction: column;
}
.home-footer-col a {
    color: var(--white-90);
    text-decoration: none;
    font-size: 0.88rem;
    padding: 0.2rem 0;
    transition: color 0.2s;
    border-bottom: none;
}
.home-footer-col a:hover {
    color: var(--white);
    border-bottom: none;
}
.home-footer-bottom {
    border-top: 1px solid var(--white-20);
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem 0.8rem;
    font-size: 0.78rem;
    color: var(--white-70);
}
.home-footer-bottom a {
    color: var(--white-70);
    text-decoration: none;
    border-bottom: none;
}
.home-footer-bottom a:hover {
    color: var(--white);
    border-bottom: none;
}
.home-footer-bottom .page-footer-sep {
    color: var(--white-20);
}
.home-footer-bottom .page-footer-build {
    color: var(--white-50);
}

/* Page footer — static bottom */

.page-footer {
    background: var(--terracotta);
    color: var(--white);
    text-align: center;
    padding: 1.2rem 2rem;
    font-size: 0.82rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}
.page-footer a {
    color: var(--white);
    text-decoration: none;
    border-bottom: none;
}
.page-footer a:hover {
    text-decoration: underline;
    border-bottom: none;
}
.page-footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem 0.8rem;
}
.page-footer-sep {
    color: var(--white-50);
}
.page-footer-build {
    color: var(--white-50);
    font-size: 0.78em;
}

/* Responsive */

@media (max-width: 640px) {
    html { font-size: 16px; }
    body { padding-bottom: 0; }
    .page-footer { position: static; }
    .home-hero { min-height: 0; padding: 3rem 1.2rem 4rem; }
    .home-hero-line { font-size: clamp(1.5rem, 7vw, 2.4rem); }
    .home-hero-sub { font-size: clamp(0.8rem, 3vw, 1rem); }
    .page-hero { padding: 3rem 1.2rem 5rem; }
    .page-hero::after,
    .home-hero::after { clip-path: ellipse(75% 100% at 50% 100%); }
    .page-hero-back { top: 1rem; left: 1.2rem; font-size: 0.78rem; }
    .page-hero-lang { top: 1rem; right: 1.2rem; font-size: 0.78rem; }
    .page-content { padding: 2rem 1.2rem 3rem; }
    .contact-form { padding: 1.5rem; }
    .article-card { flex-direction: column; }
    .article-card-thumb { width: 100%; height: auto; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
    .article-card-body { padding: 1.2rem !important; }
    .home-services-grid { grid-template-columns: 1fr; }
    .home-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .home-stats { padding: 1.5rem; }
    .home-projects-grid { grid-template-columns: 1fr; }
    .home-hero-cta { font-size: 0.9rem; padding: 0.65rem 1.5rem; }
    .site-nav-toggle { display: flex; }
    .site-nav-links {
        display: none;
        position: absolute;
        top: 56px; left: 0; right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem 2rem 1.5rem;
        gap: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
    .site-nav-links a {
        padding: 0.6rem 0;
        border-bottom: 1px solid var(--border);
        font-size: 0.95rem;
    }
    .site-nav-links a:last-child { border-bottom: none; }
    .nav-open .site-nav-links { display: flex; }
    .nav-open .site-nav-toggle span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .nav-open .site-nav-toggle span:nth-child(2) { opacity: 0; }
    .nav-open .site-nav-toggle span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
    .home-contact-grid { grid-template-columns: 1fr; gap: 2rem; }
    .home-footer-inner { grid-template-columns: 1fr; gap: 1.5rem; text-align: center; align-items: center; }
    .home-footer-col { align-items: center; }
    .home-footer-bottom { flex-direction: column; gap: 0.3rem; }
    .home-footer-bottom .page-footer-sep { display: none; }
    .page-footer-links { flex-direction: column; gap: 0.3rem; }
    .page-footer-sep { display: none; }
}

@media (max-height: 500px) {
    body { padding-bottom: 0; }
    .page-footer { position: static; }
}
