/*
 * Sekce úvodní stránky: hero (bento), projekty, zakladatel, studio,
 * kontakt a patička. Rozměry a barvy odpovídají návrhu „Gosling Portfolio v4“.
 * Responzivní úpravy jsou zvlášť v responsive.css.
 */

/* ---------- Hero ---------- */
.hero {
    padding-top: 96px;
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px;
    min-height: 100vh; align-content: stretch;
}
.hero__visual { grid-column: 1 / span 8; position: relative; border-radius: var(--radius-xl); overflow: hidden; background: var(--surface); min-height: 520px; }
.hero__visual .shade { background: linear-gradient(180deg, rgba(13, 14, 13, .15) 0%, rgba(13, 14, 13, 0) 35%, rgba(13, 14, 13, .85) 100%); }
.hero__badge {
    position: absolute; top: 24px; left: 28px; right: 28px;
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 12px; letter-spacing: .04em; color: var(--ink-85); text-shadow: 0 1px 12px rgba(13, 14, 13, .6);
}
.hero__title-wrap { position: absolute; left: 28px; right: 28px; bottom: 28px; }
.hero__title { margin: 0; font-weight: 500; font-size: clamp(44px, 6.4vw, 104px); line-height: .95; letter-spacing: -.04em; text-wrap: balance; max-width: 14ch; }
.hero__side { grid-column: 9 / span 4; display: grid; grid-template-rows: 1fr auto; gap: 16px; min-height: 520px; }
.hero__card {
    border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--ink-06);
    padding: 28px; display: flex; flex-direction: column; justify-content: flex-start; gap: 22px;
}
.hero__lead { margin: 0; font-size: clamp(24px, 2.1vw, 34px); line-height: 1.22; letter-spacing: -.025em; font-weight: 500; text-wrap: pretty; }
.hero__chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.hero__cta {
    border-radius: var(--radius-xl); background: var(--accent); color: var(--bg);
    padding: 24px 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
    transition: transform .2s var(--ease-soft), opacity .9s var(--ease-soft);
}
.hero__cta:hover { transform: scale(.985); color: var(--bg); }
.hero__cta-text { font-size: 18px; font-weight: 500; letter-spacing: -.01em; }
.hero__cta-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--bg); color: var(--accent); display: grid; place-items: center; font-size: 18px; flex: none; }

/* ---------- Projekty ---------- */
.projects__title { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; padding: 0 8px 40px; }
.projects__title h2 { margin: 0; font-weight: 500; font-size: clamp(32px, 4vw, 56px); letter-spacing: -.035em; line-height: 1; }
.projects__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.projects__noscript { grid-column: 1 / -1; margin: 0; padding: 24px; color: var(--ink-60); display: flex; flex-direction: column; gap: 12px; list-style: none; font-size: 17px; }
.card {
    position: relative; display: block; border-radius: var(--radius-xl); overflow: hidden;
    background: var(--surface); width: 100%; min-width: 0; color: var(--text); cursor: pointer;
    transition: transform .8s var(--ease-out), opacity .9s var(--ease-soft); will-change: transform;
}
.card--wide { grid-column: 1 / span 2; aspect-ratio: 21 / 9; }
.card--half { grid-column: span 1; aspect-ratio: 4 / 3; }
.card:hover { transform: scale(.99); color: var(--text); }
/* Široká karta aplikace: vějíř telefonů vpravo, vlevo zůstane místo pro popis a název */
.card--wide .shot--app { --fan-x: 66%; }
/* Po najetí se zařízení v kartě nadzvednou a prohlížeč se narovná — obraz „jde k vám“ */
.card:hover .shot__browser { transform: rotateY(-4deg) rotateX(2deg) translateY(-8px); }
.card:hover .shot--web .shot__phone { transform: translateY(-14px); }
.card:hover .shot--app .shot__phone--l { transform: rotate(-9deg) translateX(-8px); }
.card:hover .shot--app .shot__phone--r { transform: rotate(9deg) translateX(8px); }
.card:hover .shot--app .shot__phone--c { transform: translate(-50%, -10px); }
.card:hover .shot__board--front { transform: rotateY(-4deg) rotateX(2deg) translateY(-8px); }
.card:hover .shot__board--back { transform: rotateY(-9deg) rotateX(4deg) translate(-6px, -6px); opacity: .85; }
/* Dole silnější než v návrhu: název a tagline leží přes světlý screenshot v rámečku */
.card .shade { background: linear-gradient(180deg, rgba(13, 14, 13, .15) 0%, rgba(13, 14, 13, 0) 30%, rgba(13, 14, 13, .35) 58%, rgba(13, 14, 13, .92) 100%); }
.card__type { position: absolute; top: 22px; left: 22px; font-size: 12px; letter-spacing: .04em; color: var(--ink-85); text-shadow: 0 1px 12px rgba(13, 14, 13, .6); }
.card__bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 14px; }
.card__tagline { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding: 0 22px; font-size: 13px; color: rgba(241, 239, 232, .8); }
.card__tagline span { max-width: 36ch; line-height: 1.45; }
/* Název vyjíždí zespodu karty; maska ho dole rozpouští, aby přesah nepůsobil uříznutě */
.card__name-wrap {
    overflow: hidden; padding: 0 22px; margin-bottom: -.16em;
    -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 50%, transparent 100%);
}
.card__name {
    display: inline-flex; white-space: nowrap; font-weight: 600;
    font-size: clamp(48px, 7vw, 120px); line-height: 1; letter-spacing: -.045em;
    color: rgba(241, 239, 232, .92); will-change: transform;
}
.card__name span { padding-right: .4em; }
.card__name-dup { display: none; }
/* Delší název než karta: druhá kopie + marquee, běží jen po najetí (rychlost nastaví JS) */
.card__name.is-overflow { animation: gs-marquee var(--marquee-dur, 8s) linear infinite; animation-play-state: paused; }
.card__name.is-overflow .card__name-dup { display: inline; }
.card:hover .card__name.is-overflow { animation-play-state: running; }

/* ---------- Zakladatel ---------- */
.founder__card {
    border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--ink-06); overflow: hidden;
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
}
.founder__portrait { grid-column: 1 / span 4; position: relative; min-height: 440px; background: var(--surface-deep); }
.founder__portrait > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.founder__placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink-40); font-size: 12px; letter-spacing: .04em; }
.founder__placeholder svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.founder__portrait .shade { background: linear-gradient(180deg, rgba(13, 14, 13, 0) 55%, rgba(13, 14, 13, .75) 100%); }
.founder__who { position: absolute; left: 24px; bottom: 22px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.founder__name { font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.founder__role { font-size: 12px; letter-spacing: .04em; color: rgba(241, 239, 232, .7); }
.founder__body { grid-column: 5 / span 8; padding: 40px 40px 32px; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.founder__statement { margin: 0; font-size: clamp(24px, 2.4vw, 38px); line-height: 1.15; letter-spacing: -.03em; font-weight: 500; text-wrap: balance; max-width: 26ch; }
.founder__text { margin: 0; font-size: 16px; line-height: 1.6; color: rgba(241, 239, 232, .62); max-width: 56ch; text-wrap: pretty; }
.timeline { margin-top: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; border-top: 1px solid var(--ink-12); padding-top: 24px; }
.tl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tl__when { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-45); }
.tl__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: none; animation: gs-pulse 1.8s ease-in-out infinite; }
.tl--now .tl__when { color: var(--accent); }
.tl--now .tl__dot { display: inline-block; }
.tl__title { font-size: 16px; font-weight: 500; letter-spacing: -.015em; line-height: 1.3; }
.tl__body { font-size: 13px; line-height: 1.5; color: var(--ink-55); text-wrap: pretty; }
.founder__sign { font-size: 14px; color: var(--ink-60); }

/* ---------- Studio ---------- */
.studio__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; padding: 0 8px; }
.studio__statement { grid-column: 1 / span 11; margin: 0; font-size: clamp(34px, 4.6vw, 72px); line-height: 1.04; letter-spacing: -.04em; font-weight: 500; text-wrap: balance; }
.studio__body { grid-column: 1 / span 6; margin: 24px 0 0; font-size: 17px; line-height: 1.6; color: var(--ink-60); max-width: 52ch; }
.studio__spacer { grid-column: 1 / span 12; height: 80px; }
.studio__visual { grid-column: 1 / span 5; position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); aspect-ratio: 4 / 5; }
/* Obrázky služeb leží přes sebe, aktivní se prolne a dojede ze zvětšení na 1:1 */
.studio__visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transform: scale(1.06); transition: opacity .9s var(--ease-out), transform 1.6s var(--ease-out); }
.studio__visual img.is-active { opacity: 1; transform: scale(1); }
.studio__visual .shade { background: linear-gradient(180deg, rgba(13, 14, 13, 0) 60%, rgba(13, 14, 13, .7) 100%); }
.studio__caption { position: absolute; left: 22px; bottom: 20px; font-size: 12px; letter-spacing: .04em; color: var(--ink-85); }
.studio__tabs { grid-column: 7 / span 6; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.studio__list { display: flex; flex-direction: column; border-top: 1px solid var(--ink-12); }
.svc {
    all: unset; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; align-items: start;
    padding: 24px 0; border-bottom: 1px solid var(--ink-12); cursor: pointer; text-align: left; color: var(--text);
}
.svc:focus-visible { color: var(--accent); }
.svc__num { font-size: 12px; padding-top: 8px; font-variant-numeric: tabular-nums; color: var(--ink-40); transition: color .5s; }
.svc__main { display: flex; flex-direction: column; min-width: 0; }
.svc__name { font-size: clamp(22px, 2.2vw, 32px); font-weight: 500; letter-spacing: -.025em; line-height: 1.1; color: var(--ink-55); transition: color .5s; }
.svc__desc { display: block; overflow: hidden; max-height: 0; opacity: 0; transition: max-height .7s var(--ease-out), opacity .5s var(--ease-out); }
.svc__desc span { display: block; padding-top: 12px; font-size: 15px; line-height: 1.55; color: var(--ink-60); max-width: 44ch; }
.svc.is-active .svc__num { color: var(--accent); }
.svc.is-active .svc__name { color: var(--text); }
.svc.is-active .svc__desc { max-height: 140px; opacity: 1; }

/* ---------- Kontakt ---------- */
.contact__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.contact__card { grid-column: 1 / span 5; position: relative; border-radius: var(--radius-xl); overflow: hidden; background: var(--surface); min-height: 480px; }
.contact__card .shade { background: linear-gradient(180deg, rgba(13, 14, 13, .2) 0%, rgba(13, 14, 13, .85) 100%); }
.contact__content { position: absolute; left: 28px; right: 28px; bottom: 28px; display: flex; flex-direction: column; gap: 14px; }
.contact__title { margin: 0; font-weight: 500; font-size: clamp(34px, 3.6vw, 56px); letter-spacing: -.035em; line-height: .98; text-wrap: balance; }
.contact__text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-75); }
.contact__mail { font-size: 14px; color: var(--accent); }
.form {
    grid-column: 6 / span 7; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--ink-06);
    padding: 32px; display: flex; flex-direction: column; gap: 20px; min-height: 480px; position: relative;
}
.form__fields { display: contents; } /* pole jsou přímo ve flexu formuláře, aby fungoval pružný spacer */
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 12px; letter-spacing: .04em; color: var(--ink-55); min-width: 0; }
.field input, .field textarea {
    width: 100%; min-width: 0; background: rgba(241, 239, 232, .05); border: 1px solid var(--ink-10);
    border-radius: var(--radius-md); padding: 14px 16px; color: var(--text); font-size: 15px; outline: none;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field .is-invalid { border-color: #e6a39a; }
.form__budget { display: flex; flex-direction: column; gap: 10px; font-size: 12px; letter-spacing: .04em; color: var(--ink-55); }
.form__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.budget { cursor: pointer; padding: 10px 16px; border-radius: 999px; font-size: 13px; border: 1px solid var(--ink-12); background: rgba(241, 239, 232, .05); color: var(--text); transition: all .2s; }
.budget[aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.form__spacer { flex: 1; }
.form__actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.form__note { font-size: 12px; color: var(--ink-45); max-width: 34ch; line-height: 1.5; }
.form__error { font-size: 13px; color: #e6a39a; line-height: 1.5; max-width: 40ch; }
.form__note a { color: var(--ink-60); text-decoration: underline; text-underline-offset: 2px; }
.form__note a:hover { color: var(--accent); }
/* Hláška u konkrétního pole — plní ji js/contact-form.js z GS.T, ukáže se jen s třídou has-error */
.field__error { display: none; font-size: 12px; letter-spacing: 0; line-height: 1.4; color: #e6a39a; }
.field.has-error .field__error { display: block; }
/* Tlačítko odeslání: stavy idle / sending / sent / error přes data-state (js/contact-form.js) */
.form__submit {
    cursor: pointer; border: 0; background: var(--text); color: var(--bg); padding: 16px 26px; border-radius: 999px;
    font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform .15s, background .25s, opacity .25s;
}
.form__submit:hover { background: var(--accent); transform: scale(.97); }
.form__submit:hover .form__submit-icon::before { transform: translateX(3px); }
.form__submit:disabled { cursor: default; transform: none; }
/* Ikona: šipka v klidu, fajfka po odeslání; při odesílání ji nahradí točící se kroužek */
.form__submit-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; }
.form__submit-icon::before { content: '→'; display: block; transition: transform .3s var(--ease-out); }
.form__spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(13, 14, 13, .25); border-top-color: var(--bg); animation: gs-spin .8s linear infinite; }
.form__submit[data-state="sending"] { opacity: .85; cursor: progress; }
.form__submit[data-state="sending"] .form__submit-icon { display: none; }
.form__submit[data-state="sending"] .form__spinner { display: block; }
.form__submit[data-state="sent"] { background: var(--accent); opacity: 1; }
.form__submit[data-state="sent"] .form__submit-icon::before { content: '✓'; }
.form__submit[data-state="error"] { animation: gs-shake .5s var(--ease-out); }
@keyframes gs-spin { to { transform: rotate(360deg); } }
@keyframes gs-shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-5px); }
    40%, 60% { transform: translateX(5px); }
}
.form__sent { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.form__check { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--bg); display: grid; place-items: center; font-size: 22px; }
.form__sent h3 { margin: 0; font-size: clamp(28px, 3vw, 44px); letter-spacing: -.03em; font-weight: 500; }
.form__sent p { margin: 0; color: rgba(241, 239, 232, .65); font-size: 15px; line-height: 1.55; max-width: 44ch; }
/* Honeypot: mimo obrazovku, ne display:none — boti by ho přeskočili */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Patička ---------- */
.footer { margin: 120px 0 32px; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--ink-06); padding: 48px 40px 28px; }
.footer__grid { display: grid; grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(140px, 1fr)); gap: 40px 32px; }
.footer__brand { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.footer__logo { font-size: clamp(26px, 2.6vw, 38px); font-weight: 500; letter-spacing: -.035em; line-height: 1; }
.footer__tagline { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-60); max-width: 36ch; text-wrap: pretty; }
.footer__col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.footer__col-title { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-40); }
.footer__links { display: flex; flex-direction: column; gap: 12px; }
.footer__col a, .footer__plain { font-size: 15px; color: var(--ink-78); }
.footer__col a:hover { color: var(--accent); }
.footer__socials { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.footer__socials a { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--ink-14); font-size: 12px; color: var(--ink-78); }
.footer__socials a:hover { border-color: var(--accent); color: var(--accent); }
.footer__bottom {
    display: flex; justify-content: space-between; align-items: center; gap: 16px 28px; flex-wrap: wrap;
    margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--ink-10);
    font-size: 12px; color: rgba(241, 239, 232, .42);
}
.footer__bottom a { color: rgba(241, 239, 232, .42); }
.footer__bottom a:hover { color: var(--accent); }
.footer__bottom-links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
