/* ==========================================================================
   Veebimets - Projektilehtede jagatud stiilid
   Kasutusel: ondine.html, saemees.html, sarmet.html
   ========================================================================== */

/* --- CSS muutujad (kõikide lehtede ühised värvid ja väärtused) --- */
:root {
    --primary: #2C3E30;
    --accent: #D4A373;
    --bg: #FAF9F6;
    --text: #333;
    --text-light: #555;
    --white: #fff;
}

/* --- Lähtestamine ja üldised baasstiiilid --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Lato', sans-serif;
    line-height: 1.8;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--primary);
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px;
}

/* --- Päis (sticky header koos logo ja tagasilingiga) --- */
header {
    background: rgba(255, 255, 255, 0.98);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img { height: 55px; }

.back {
    color: var(--primary);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s;
}

.back:hover {
    background: var(--primary);
    color: var(--white);
}

/* --- Hero sektsioon (peamine esitlusala) --- */
.hero {
    padding: 70px 0 60px;
    background: linear-gradient(180deg, var(--white) 0%, var(--bg) 100%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 80px;
    align-items: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 18px;
    line-height: 1.15;
}

.hero h1 img {
    height: 42px;
    vertical-align: middle;
    margin-left: 10px;
}

.hero-intro {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 25px;
    line-height: 1.7;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.meta span {
    background: var(--white);
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 14px;
    color: var(--text-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.link {
    padding: 14px 26px;
    background: var(--white);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    box-shadow: 0 3px 15px rgba(0,0,0,0.06);
    transition: all 0.3s;
}

.link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.link-primary {
    background: var(--primary);
    color: var(--white);
}

/* --- Hero pilt koos dekoratiivse taustaga --- */
.hero-img-wrap {
    position: relative;
}

.hero-img-wrap::before {
    content: '';
    position: absolute;
    top: -15px;
    right: -15px;
    width: 100%;
    height: 100%;
    background: var(--accent);
    opacity: 0.1;
    border-radius: 16px;
}

.hero-img {
    position: relative;
    width: 100%;
    border-radius: 14px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.12);
}

/* --- Sektsioonide baasstiilid --- */
section {
    padding: 70px 0;
}

/* --- Infokaardid (üldised stiilid) --- */
.info-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.04);
}

.info-card h3 {
    font-size: 22px;
    margin-bottom: 18px;
}

.info-card p {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.75;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    padding: 12px 0;
    padding-left: 26px;
    position: relative;
    color: var(--text-light);
    font-size: 15px;
    border-bottom: 1px solid #f5f5f5;
}

.info-card li:last-child { border-bottom: none; }

.info-card li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* --- Galerii elemendid --- */
.gallery-item {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 15px 45px rgba(0,0,0,0.25);
}

.gallery-item img {
    width: 100%;
    display: block;
}

.gallery-label {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    text-align: center;
    margin-top: 15px;
}

/* --- Telefoni mockup (showcase sektsioon) --- */
.phone-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.phone-container::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212,163,115,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.phone {
    position: relative;
    width: 220px;
    background: #0a0a0a;
    border-radius: 36px;
    padding: 10px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

.phone img {
    width: 100%;
    border-radius: 26px;
    display: block;
}

.phone-label {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    text-align: center;
    margin-top: 18px;
}

/* --- Tulemuste sektsioon --- */
.results-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.result-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.05);
}

.result-card h3 {
    font-size: 22px;
    margin-bottom: 20px;
}

.result-card p {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 18px;
    line-height: 1.75;
}

/* --- Tehnoloogia sildid --- */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-tag {
    background: var(--bg);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    transition: all 0.3s;
}

.tech-tag:hover {
    background: var(--accent);
    color: var(--white);
}

/* --- Lopprea: tsitaat ja CTA kaardid --- */
.final-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 30px;
    margin-top: 50px;
}

.quote-card {
    background: linear-gradient(135deg, var(--primary) 0%, #1a261d 100%);
    padding: 50px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.quote-card::before {
    content: '\201C';
    position: absolute;
    top: 15px;
    left: 35px;
    font-size: 120px;
    color: rgba(255,255,255,0.05);
    font-family: Georgia, serif;
    line-height: 1;
}

.quote-card p {
    font-size: 19px;
    font-style: italic;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.7;
    position: relative;
}

.quote-author {
    font-style: normal;
    font-weight: 700;
    font-size: 14px;
    color: var(--accent);
}

.cta-card {
    background: var(--accent);
    padding: 50px 35px;
    border-radius: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cta-card h3 {
    color: var(--white);
    font-size: 24px;
    margin-bottom: 12px;
}

.cta-card p {
    color: rgba(255,255,255,0.85);
    margin-bottom: 25px;
    font-size: 15px;
}

/* --- Nupp (CTA) --- */
.btn {
    display: inline-block;
    background: var(--white);
    color: var(--primary);
    padding: 16px 35px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* --- Jalus --- */
footer {
    text-align: center;
    padding: 45px;
    color: var(--text-light);
    font-size: 13px;
    border-top: 1px solid #eee;
}

/* ==========================================================================
   Animatsioonid
   ========================================================================== */

/* --- Keyframe animatsioonid --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 30px 60px rgba(0,0,0,0.4); }
    50% { box-shadow: 0 40px 80px rgba(212,163,115,0.3); }
}

/* --- Keritav ilmumise susteeem (scroll-animatsioonid) --- */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.visible {
    opacity: 1;
}

.fade-up { transform: translateY(40px); }
.fade-up.visible { transform: translateY(0); }

.fade-left { transform: translateX(-40px); }
.fade-left.visible { transform: translateX(0); }

.fade-right { transform: translateX(40px); }
.fade-right.visible { transform: translateX(0); }

.scale-in { transform: scale(0.9); }
.scale-in.visible { transform: scale(1); }

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* --- Hero animatsioonid --- */
.hero-content {
    animation: fadeInLeft 0.8s ease forwards;
}
.hero-img-wrap {
    animation: fadeInRight 0.8s ease 0.2s forwards;
    opacity: 0;
    animation-fill-mode: forwards;
}

/* --- Telefoni animatsioon (hoverdamine + kuma) --- */
.phone {
    animation: float 4s ease-in-out infinite, pulseGlow 4s ease-in-out infinite;
}

/* --- Tsitaadikaardi sära-efekt --- */
.quote-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255,255,255,0.03) 50%,
        transparent 100%
    );
    transform: rotate(30deg);
    animation: shimmer 6s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(30deg); }
    100% { transform: translateX(100%) rotate(30deg); }
}

/* --- Nupu ripple-efekt --- */
.btn {
    position: relative;
    overflow: hidden;
}
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(44, 62, 48, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* --- Galerii hover-efektid --- */
.gallery-item {
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 60px rgba(0,0,0,0.2);
}
.gallery-item img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.gallery-item:hover img {
    transform: scale(1.08);
}

/* --- Sujuv kerimine ja horisontaalse ülevoolu keelamine --- */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* --- Ligipääsetavus: vähendatud liikumine --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Responsiivsed stiiilid (jagatud murdepunktid)
   ========================================================================== */

@media (max-width: 1100px) {
    .container { padding: 0 40px; }
    .results-row { grid-template-columns: 1fr; }
    .final-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .container { padding: 0 25px; }
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .hero h1 { font-size: 36px; }
    .hero-img-wrap::before { right: 0; top: -8px; }
    .phone-container::before { width: 220px; height: 220px; }
}

@media (max-width: 550px) {
    .container { padding: 0 15px; }
    section { padding: 50px 0; }
    .hero { padding: 50px 0 40px; }
    .hero h1 { font-size: 30px; }
    .hero h1 img { height: 26px; }
    .hero-img-wrap::before { right: 0; top: -8px; }
    .info-card { padding: 25px 20px; }
    .result-card { padding: 25px 20px; }
    .quote-card, .cta-card { padding: 30px 20px; }
    .phone-container::before { width: 180px; height: 180px; }
    .phone { width: 180px; border-radius: 28px; padding: 8px; }
    .phone img { border-radius: 20px; }
    footer { padding: 30px 15px; }
}
