* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--fg-light);
    background-color: var(--page-bg);
    padding-top: 70px;
    align-items: center;
    justify-content: center;
}

:root {
  --bg-dark: #313E50;
  --bg-darker: #1F2937;
  --bg-medium: #4A5A72;
  --fg-light: #ffffff;
  --fg-muted: #D1D5DB;
  --fg-dim: #9CA3AF;
  --accent-primary: #3B82F6;
  --accent-light: #60A5FA;
  --accent-dark: #1D4ED8;
  --border: #4A5A72;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --page-bg: #161F2E;
  --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  background: url('assets/main_hero-bg.png') center/cover no-repeat;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 0 1rem;
}

.hero-content h1 {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--fg-light);
  line-height: 1.1;
}

.hero-content h2 {
  font-size: 2rem;
  font-weight: 400;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.4;
}

.services {
  padding: 6rem 2rem;
  background-color: var(--bg-darker);
  text-align: center;
  border-top: none;
}

.service {
  background-color: var(--bg-darker);
  padding: 1.5rem;
  margin: 1rem auto;
  max-width: 600px;
  border-radius: 6px;
  border: 1px solid var(--border);
  text-align: left;
  position: relative;
  margin-top: 0;
}

.service-detail {
  display: block;
  margin-top: 0.5rem;
  color: var(--fg-dim);
  font-size: 0.9rem;
  font-style: italic;
}

.services h2,
.services h3,
.services h4 {
  margin: 2rem 0;
  color: var(--fg-light);
}

.services h2 {
  font-size: 1.8rem;
}

.services h3 {
  font-size: 1.2rem;
  font-weight: 500;
}

.services h4 {
  font-size: 1rem;
  font-weight: 400;
}

.services h4 a {
  color: var(--accent-primary);
  text-decoration: none;
}

.services h4 a:hover {
  text-decoration: underline;
}

.contact {
  padding: 6rem 2rem;
  background-color: var(--bg-dark);
  text-align: center;
}

.contact h2 {
  font-size: 2rem;
  color: var(--fg-light);
  margin-bottom: 2rem;
}

.contact-info {
  max-width: 600px;
  margin: 0 auto;
}

.contact-info p {
  color: var(--fg-muted);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

.contact-info a {
  color: var(--accent-primary);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.head-title {
    text-align: center;
    color: var(--fg-light);
    font-size: 3.5rem;
    margin: 3rem 0 2rem 0;
    font-weight: 700;
}
 
.project-grid {
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    max-width: 1200px;
    margin: 0 auto;
}
 
.project-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}
 
.project-card-wrapper {
    display: inline-block;
    width: 100%;
    max-width: 320px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}
 
.project-card {
    display: block;
    width: 100%;
    text-decoration: none;
}
 
.project-card-wrapper:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.4);
}
 
.project-card img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top;
}
 
.project-quality {
    background-color: var(--bg-dark);
    color: var(--fg-muted);
    border-top: 1px solid var(--border);
    font-size: 1rem;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    font-weight: 600;
}
 
.project-quality p {
    margin: 0.75rem 0;
}

.features {
    padding-left: 0;
    margin: 1rem 0 2rem;
    max-width: 700px;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.features li {
    list-style: none;
    margin-bottom: 0;
    line-height: 1.6;
    font-size: 1.05rem;
    background-color: var(--bg-dark);
    padding: 1.2rem 1.5rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--accent-primary);
    transition: transform 0.2s ease, background-color 0.2s ease;
    position: relative;
    cursor: help;
}

.features li:hover {
    background-color: var(--accent-primary);
    transform: scale(1.05);
}

.features .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-darker);
    color: var(--fg-light);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    width: 250px;
    z-index: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
}

.features .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--bg-darker);
}

.features .tooltip-down {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-darker);
    color: var(--fg-light);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    width: 250px;
    z-index: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
}

.features .tooltip-down::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: var(--bg-darker);
}

.features li:hover .tooltip,
.features li:hover .tooltip-down {
    visibility: visible;
    opacity: 1;
}

.values {
    color: var(--fg-muted);
    padding-left: 0;
    margin: 1rem 0 2rem;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.values li {
    margin-bottom: 0;
    line-height: 1.6;
    font-size: 1.05rem;
    background-color: var(--bg-dark);
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    border-left: 3px solid var(--accent-primary);
}

.reveal.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

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

.hero-content h1 {
    animation: heroFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.1s;
    letter-spacing: -1px;
}

.hero-content h2 {
    animation: heroFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.3s;
}

.services {
    background: linear-gradient(180deg, var(--bg-darker) 0%, #1a2433 100%);
}

.services h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 0.9rem;
}

.services h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-light));
}

.service {
    background: linear-gradient(145deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    overflow: hidden;
}

.service::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-light));
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.service:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.service:hover::before {
    transform: scaleY(1);
}

.services h4 a {
    position: relative;
    transition: color 0.3s ease;
}

.services h4 a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background-color: var(--accent-light);
    transition: width 0.3s ease;
}

.services h4 a:hover {
    color: var(--accent-light);
    text-decoration: none;
}

.services h4 a:hover::after {
    width: 100%;
}

.contact {
    background: linear-gradient(180deg, var(--bg-dark) 0%, #2a3547 100%);
}

.contact h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 0.9rem;
    margin-bottom: 2.5rem;
}

.contact h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-light));
}

.contact-info {
    background-color: rgba(22, 31, 46, 0.45);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem 1.5rem;
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.contact-info:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.contact-info a {
    position: relative;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--accent-light);
}

.contact-form {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.contact-form label {
    color: var(--fg-muted);
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    background-color: rgba(22, 31, 46, 0.6);
    color: var(--fg-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1.2rem;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.contact-form textarea {
    resize: vertical;
}

.contact-form fieldset {
    border: none;
    margin-bottom: 1.2rem;
}

.contact-form legend {
    color: var(--fg-muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.contact-form .radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--fg-muted);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.contact-form .radio-option:hover {
    background-color: rgba(22, 31, 46, 0.3);
    color: var(--fg-light);
}

.contact-form .radio-option input {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    background-color: rgba(22, 31, 46, 0.6);
}

.contact-form .radio-option input:checked {
    border-color: var(--accent-primary);
    background-color: var(--accent-primary);
}

.contact-form .radio-option input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.65rem;
    height: 0.65rem;
    background-color: var(--fg-light);
    border-radius: 50%;
}

.contact-form .radio-option input:hover {
    border-color: var(--accent-light);
    background-color: rgba(22, 31, 46, 0.7);
}

.contact-form .radio-option input:checked:hover {
    background-color: var(--accent-light);
}

.contact-form button {
    align-self: center;
    width: fit-content;
    padding: 0.9rem 2.5rem;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.contact-form button:hover {
    background-color: var(--accent-light);
}

/* Contact: form + code editor animation side by side */
.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: stretch;
    max-width: 1150px;
    margin: 0 auto;
}

.contact-layout .contact-info {
    max-width: none;
}

.code-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--page-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.code-window:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.code-window-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: rgba(22, 31, 46, 0.85);
    border-bottom: 1px solid var(--border);
}

.code-window-header .dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.code-window-header .dot.red { background: var(--error); }
.code-window-header .dot.yellow { background: var(--warning); }
.code-window-header .dot.green { background: var(--success); }

.code-window-title {
    margin-left: 0.6rem;
    color: var(--fg-dim);
    font-family: 'Cascadia Code', 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: 0.8rem;
}

.code-body {
    flex: 1;
    padding: 1.4rem 1.5rem;
    font-family: 'Cascadia Code', 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.9;
    text-align: left;
}

.code-line {
    display: block;
    white-space: pre;
    overflow: hidden;
    width: 0;
}

/* Typing only runs while .typing is set on the window (JS adds it on scroll) */
.code-window.typing .code-line {
    animation: codeTyping 0.8s steps(36, end) forwards;
}

.code-window.typing .code-line:nth-child(1) { animation-delay: 0.2s; }
.code-window.typing .code-line:nth-child(2) { animation-delay: 0.7s; }
.code-window.typing .code-line:nth-child(3) { animation-delay: 1.2s; }
.code-window.typing .code-line:nth-child(4) { animation-delay: 1.7s; }
.code-window.typing .code-line:nth-child(5) { animation-delay: 2.2s; }
.code-window.typing .code-line:nth-child(6) { animation-delay: 2.7s; }
.code-window.typing .code-line:nth-child(7) { animation-delay: 3.2s; }
.code-window.typing .code-line:nth-child(8) { animation-delay: 3.7s; }
.code-window.typing .code-line:nth-child(9) { animation-delay: 4.2s; }
.code-window.typing .code-line:nth-child(10) { animation-delay: 4.7s; }
.code-window.typing .code-line:nth-child(11) { animation-delay: 5.2s; }
.code-window.typing .code-line:nth-child(12) { animation-delay: 5.7s; }
.code-window.typing .code-line:nth-child(13) { animation-delay: 6.2s; }

.code-line .tag { color: var(--accent-light); }
.code-line .attr { color: var(--accent-primary); }
.code-line .val { color: var(--success); }
.code-line .txt { color: var(--fg-muted); }
.code-line .cmt { color: var(--fg-dim); font-style: italic; }

.code-cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.1em;
    margin-top: 0.3rem;
    background: var(--accent-primary);
    animation: codeBlink 1s steps(1) infinite;
}

@keyframes codeTyping {
    to { width: 100%; }
}

@keyframes codeBlink {
    50% { opacity: 0; }
}

.thanks-content {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.thanks-content h1 {
    font-size: clamp(2.1rem, 7.5vw, 4rem);
    color: var(--fg-light);
    margin-bottom: 1.5rem;
}

.head-title {
    position: relative;
    padding-bottom: 1.2rem;
    letter-spacing: -1px;
}

.head-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-light));
}

.project-card img {
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover img {
    transform: scale(1.06);
}

.project-quality {
    transition: background-color 0.35s ease, color 0.35s ease;
}

.project-card-wrapper:hover .project-quality {
    color: var(--fg-light);
}

.features li {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease, box-shadow 0.3s ease;
}

.features li:hover {
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.25);
}

.values li {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-left-color 0.3s ease, background-color 0.3s ease;
}

.values li:hover {
    transform: translateX(6px);
    background-color: #3a4a61;
    border-left-color: var(--accent-light);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 3px;
    border-radius: 4px;
}

body > button,
body > a > button {
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.28);
    transition: background-color 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

body > button:hover,
body > a > button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(59, 130, 246, 0.4);
}

body > button:active,
body > a > button:active {
    transform: translateY(-1px);
}

.hero-content h1,
.hero-content h2,
.head-title,
.services h2 {
    text-wrap: balance;
}

.project-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

.hero-content h1 {
    font-size: clamp(2.1rem, 7.5vw, 4rem);
}

.hero-content h2 {
    font-size: clamp(1.05rem, 3.8vw, 2rem);
}

.head-title {
    font-size: clamp(2rem, 7vw, 3.5rem);
}

@media (max-width: 768px) {
    body {
        padding-top: 64px;
    }

    .hero {
        min-height: 78vh;
        padding: 3rem 1.25rem;
    }

    .services,
    .contact {
        padding: 3.5rem 1.25rem;
    }

    .services h2 {
        font-size: 1.4rem;
    }

    .service {
        padding: 1.2rem;
    }

    .contact-info {
        padding: 1.5rem 1.1rem;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-info p {
        font-size: 1rem;
        word-break: break-word;
    }

    .project-grid {
        padding: 1.5rem 1.25rem;
        gap: 2rem;
    }

    .features {
        gap: 0.7rem;
        padding: 0 1rem;
    }

    .features li {
        padding: 0.9rem 1.2rem;
        font-size: 0.98rem;
    }

    .features {
        position: relative;
    }

    .features li {
        position: static;
    }

    .features li:hover {
        transform: none;
    }

    .features .tooltip,
    .features .tooltip-down {
        left: 1rem;
        right: 1rem;
        top: calc(100% + 12px);
        bottom: auto;
        width: auto;
        transform: none;
        z-index: 5;
    }

    .features .tooltip::after,
    .features .tooltip-down::after {
        display: none;
    }

    .values {
        padding: 0 1.25rem;
    }

    body > h3 {
        font-size: 1.5rem;
        margin: 2.2rem 1.25rem 1rem;
    }

    body > h6 {
        font-size: 1.15rem;
        margin: 2.2rem 1.25rem 1rem;
    }

    body > p {
        margin: 0 1.25rem 1.5rem;
        font-size: 1rem;
    }

    body > button,
    body > a > button {
        margin-bottom: 3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

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