html,
button,
input,
select,
textarea {
    color: #212121;
}
html, body {
    height: 100%;
    font-family: sans-serif;
    font-size: 16pt;
    line-height: 1.6;
    margin: 25px 25px 50px 25px;
}

@media (min-width: 1200px) {
    html, body {
        margin-left: auto;
        margin-right: auto;
        max-width: 1200px;
    }

    .hero__top {
        margin-top: 5em;
    }
}

@media (max-width: 800px) {
    html, body {
        margin: 15px;
    }
    
    .hero {
        grid-template-columns: 1fr;
        gap: 30px;
        height: auto;
        max-height: none;
    }
    
    .hero__content {
        max-width: 100%;
        gap: 30px;
    }
    
    .hero__image {
        order: -1;
        width: 100%;
        aspect-ratio: 1;
    }
    
    .projects {
        margin: 30px 10%;
    }

    .projects-grid {
        gap: 0;
    }
    
    .projects-grid__row {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1rem;
    }

    .project-card {
        margin: 0;
    }

    .projects-grid h2 {
        font-size: 24px;
    }

    .project-page {
        padding: 1rem;
    }
    
    .project-page__header {
        margin-bottom: 2rem;
    }
    
    .project-page__section {
        margin-bottom: 2rem;
    }

    .sideprojects {
        margin-top: 2em;
        margin-bottom: 2em;
    }

    .project-card__content .role {
        display: none;
    }

    .project-card__content h3 {
        display: inline-block;
    }
    
    .project-card__content .role {
        display: block;
        margin-top: 0.5rem;
    }
}

@media (max-width: 640px) {
    body {
        height: 100%;
        font-family: sans-serif;
        font-size: 14pt;
        line-height: 1.4;
    }
    .column {
        width: 100%;
    }

    h1 {
        font-size: 24pt;
        line-height: 36pt;
    }
    h2 {
        font-size: 16pt;
    }
}

@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    .ir a:after,
    a[href^="javascript:"]:after,
    a[href^="#"]:after {
        content: "";
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    @page {
        margin: 0.5cm;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}

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

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
    height: 80vh;
    max-height: 80vh;
}

.hero__content {
    max-width: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero__top {
    margin-bottom: auto;
}

.hero__bottom {
    margin-bottom: 20px;
    margin-top: auto;
}

.hero__image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.hero__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.fillwidth {
    width: 100%;
    height: 100%;
    border-radius: 32px;
    clip-path: inset(0 round 50%);
    box-shadow: 0 60px 120px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    object-position: top;
    filter: drop-shadow(0 60px 120px rgba(0, 0, 0, 0.1));
}

.column {
    float: left;
    width: 50%;
    padding: 5%;
    }
    
/* Clear floats after the columns */
.row:after {
    content: "";
    display: table;
    clear: both;
  }

/*Generates grain noise texture above img container*/
.grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.05) 1px,
        transparent 1px,
        transparent 2px
    ),
    repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.05) 1px,
        transparent 1px,
        transparent 2px
    );
    opacity: 0.2;
    mix-blend-mode: multiply;
    z-index: 2;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
    resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */


.projects {
    margin: 50px 10%;
    margin-top: 3em;
    margin-bottom: 3em;
    }

@media screen and (max-width: 800px) {
    html, body {
        margin: 15px;
    }
    
    .hero {
        grid-template-columns: 1fr;
        gap: 30px;
        height: auto;
        max-height: none;
    }
    
    .hero__content {
        max-width: 100%;
        gap: 30px;
    }
    
    .hero__image {
        order: -1;
        width: 100%;
        aspect-ratio: 1;
    }
    
    .projects {
        margin: 30px 10%;
    }

    .projects-grid {
        gap: 0;
    }
    
    .projects-grid__row {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1rem;
    }

    .project-card {
        margin: 0;
    }

    .projects-grid h2 {
        font-size: 24px;
    }

    .project-page {
        padding: 1rem;
    }
    
    .project-page__header {
        margin-bottom: 2rem;
    }
    
    .project-page__section {
        margin-bottom: 2rem;
    }

    .sideprojects {
        margin-top: 2em;
        margin-bottom: 2em;
    }

    .project-card__content .role {
        display: none;
    }

    .project-card__content h3 {
        display: inline-block;
    }
    
    .project-card__content .role {
        display: block;
        margin-top: 0.5rem;
    }
}

@media screen and (max-width: 640px) {
    body {
        height: 100%;
        font-family: sans-serif;
        font-size: 14pt;
        line-height: 1.4;
    }
    .column {
        width: 100%;
    }

    h1 {
        font-size: 24pt;
        line-height: 36pt;
    }
    h2 {
        font-size: 16pt;
    }
}

/* Глобальные стили для ссылок */
a {
    color: #3572E8;
    text-decoration: none;
}

a:hover {
    border-bottom: 1px solid #0783DC;
}

/* Стили для ссылок внутри карточек проектов */
.projects-grid a {
    color: inherit;
    text-decoration: none;
    border-bottom: none;
    display: block;
    width: 100%;
    height: 100%;
}

.projects-grid a:hover {
    border-bottom: none;
}

.project-card {
    position: relative;
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-3px);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.project-card__content {
    position: relative;
    z-index: 2;
}

.project-card__content h3 {
    margin: 0;
    font-size: 14pt;
    line-height: 1.6;
    white-space: normal;
}

.project-card__content h3 a {
    color: inherit;
    text-decoration: none;
    display: inline;
}

.project-card__content h3 a:hover {
    text-decoration: none;
}

.project-card__title-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.project-card__content h3 .period {
    font-size: 14pt;
    line-height: 1.6;
    opacity: 0.7;
    margin-left: 0.5rem;
}

.project-card__content .role {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    opacity: 1;
}

.project-card:hover .project-card__content h3 {
    border-bottom-color: currentColor;
}

/* #Megaplan {
    background: linear-gradient(180deg, #AFE8FA 0%, #EBF8FD 100%);
    position: relative;
    z-index: 1;
} */

#Megaplan::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../img/megaplan/megaplan_bg.jpeg');
    background-size: 100%;
    background-position: center top;
    background-repeat: no-repeat;
    opacity: 1;
    z-index: 0;
}

#Megaplan .project-card__content {
    position: relative;
    z-index: 1;
}

#Megaplan a {
    color: #7ab800;
    border-bottom: 1px solid rgba(122, 184, 0, 0.3);
}

#Megaplan a:hover {
    border-bottom: 1px solid #7ab800;
}

h1 {
    margin: 0;
    line-height: 36pt;
}   
h2 {
    margin: 0;
    margin-bottom: -0.6em;
    font-size: 24pt;
}   

.subline {
    margin: 0.1em 0 0.4em 0;
    line-height: 1.4em;
}

.credits {
    font-size: 0.7rem;
    line-height: 1.4;
    padding-bottom: 1.3em;
    margin-top: 0;
}

.sideprojects {
    margin-top: 3em;
    margin-bottom: 3em;
    line-height: 1.5em;
    padding-bottom: 50px;
}

.sideprojects h2 {
    margin: 0;
    margin-bottom: 0.1em;
}

.sideproject {
    margin-bottom: 2em;
}

.sideproject .title-line {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    font-size: 0.7rem;
    line-height: 1.4;
}

.sideproject .title-line h3 {
    font-size: 14pt;
}

.sideproject h3 {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    font-weight: normal;
    display: inline;
}

.sideproject .separator {
    opacity: 0.5;
}

.sideproject .period {
    opacity: 0.7;
    white-space: nowrap;
    display: inline-block;
}

#house .placeholder {
    width: 100%;
    height: 400px;
    background-image: url('../img/sideprojects/house.jpg');
    background-size: auto 100%;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 32px;
    overflow: hidden;
}

.sideproject .placeholder {
    width: 100%;
    height: 400px;
    margin-top: 0.5em;
    border-radius: 32px;
}

.sideproject .placeholder.hidden {
    display: none;
}

.sideprojects ul {
    list-style-position: inside;
    padding-left: 0;
    margin-left: 0;
}

.sideprojects li {
    list-style: none;
    margin-bottom: 0.5em;
}

.sideprojects li:before {
    content: "· ";
    font-weight: bold;
    margin-left: -0.5em;
}


/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Image replacement
 */

.ir {
    background-color: transparent;
    border: 0;
    overflow: hidden;
}

.ir:before {
    content: "";
    display: block;
    width: 0;
    height: 150%;
}


/*
 * Hide from both screenreaders and browsers: h5bp.com/u
 */

.hidden {
    display: none !important;
    visibility: hidden;
}

/*
 * Hide only visually, but have it available for screenreaders: h5bp.com/v
 */

.visuallyhidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/*
 * Extends the .visuallyhidden class to allow the element to be focusable
 * when navigated to via the keyboard: h5bp.com/p
 */

.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
    clip: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    position: static;
    width: auto;
}

/*
 * Hide visually and from screenreaders, but maintain layout
 */

.invisible {
    visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix:before,
.clearfix:after {
    content: " ";
    display: table;
}

.clearfix:after {
    clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
    /* Style adjustments for viewports that meet the condition */
}

@media print,
       (-o-min-device-pixel-ratio: 5/4),
       (-webkit-min-device-pixel-ratio: 1.25),
       (min-resolution: 120dpi) {
    /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid required HTTP connection: h5bp.com/r
   ========================================================================== */

@media print {
    * {
        background: transparent !important;
        color: #000 !important; /* Black prints faster: h5bp.com/s */
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    /*
     * Don't show links for images, or javascript/internal links
     */

    .ir a:after,
    a[href^="javascript:"]:after,
    a[href^="#"]:after {
        content: "";
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group; /* h5bp.com/t */
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    @page {
        margin: 0.5cm;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}

.intro {
    margin: 0.6em 0 0.4em 0;
    line-height: 1.4em;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.projects-grid h2 {
    margin: 0;
    margin-bottom: 0.1em;
}

.projects-grid__row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 0.5rem;
}

.project-card__image {
    width: 100%;
    aspect-ratio: 1;
    background-color: #f5f5f5;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

#belka {
    background-color: #2547B3;
    color: #FFFFFF;
    background-image: url('../img/belka/belka_bg.jpg');
    background-size: 100% auto;
    background-position: center;
    background-repeat: no-repeat;
}

#belka a {
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#belka a:hover {
    border-bottom: 1px solid #FFFFFF;
}

#belka .credits {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
}

#belka .done {
    color: rgba(255, 255, 255, 0.9);
}


 
/* Project page styles */
.project-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.project-page__header {
    margin-bottom: 4rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: inherit;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.project-page__subtitle {
    margin-top: 1rem;
    opacity: 0.7;
}

.project-page__section {
    margin-bottom: 4rem;
}

.project-page__section h2 {
    margin-bottom: 1rem;
}

@media (max-width: 800px) {
    .project-card {
        margin: 0;
    }
    
    .project-card__image {
        margin-bottom: 0.5rem;
    }
}

@media screen and (max-width: 800px) {
    .project-card__content .role {
        display: none;
    }
}

@media (max-width: 800px) {
    .project-card__content h3 {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.5em;
    }
    
    .project-card__content .role {
        display: block;
        margin-top: 0.5rem;
    }
}

.project-card__bottom {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

h3 {
    font-weight: normal;
    font-family: inherit;
}

#project-6 .project-card__image {
    background-color: #21232C;
    background-image: url('../img/dservices/ds_bg.png');
    background-size: auto 100%;
    background-position: center;
    background-repeat: no-repeat;
}

#project-6 .project-card__content {
    position: relative;
    z-index: 1;
}

#project-6 a {
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#project-6 a:hover {
    border-bottom: 1px solid #FFFFFF;
}

#project-6 .credits {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
}

#project-6 .done {
    color: rgba(255, 255, 255, 0.9);
}

#project-5 .project-card__image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../img/evilmartians/em_bg.png');
    background-size: 70%;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 1;
    z-index: 0;
}
#project-5 .project-card__image {
    position: relative;
    overflow: visible;
    background: radial-gradient(51.79% 46.88% at 96.87% 96.88%, rgba(0, 225, 165, 0.5) 27.88%, rgba(3, 3, 9, 0) 100%),
    radial-gradient(100% 100% at 50% 0%, #A63565 0%, #03080C 75%, #1A0F58 98.56%);
    /* background-image: url('../img/evilmartians/em_bg.png');
    background-size: auto 100%;
    background-repeat: no-repeat;
    opacity: 1; */
}

#project-5 .project-card__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#project-5 .project-card__bottom {
    margin-top: auto;
}

#project-5 a {
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#project-5 a:hover {
    border-bottom: 1px solid #fff;
}

#project-5 .credits {
    color: rgba(255, 255, 255, 0.7);
}


#project-4 .project-card__image {
    background-color: #2547B3;
    background-image: url('../img/belka/belka_bg.jpg');
    background-size: 100% auto;
    background-position: center;
    background-repeat: no-repeat;
}

#project-4 .project-card__content {
    position: relative;
    z-index: 1;
}

#project-4 a {
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#project-4 a:hover {
    border-bottom: 1px solid #FFFFFF;
}

#project-4 .credits {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
}

#project-4 .done {
    color: rgba(255, 255, 255, 0.9);
}


#project-3 .project-card__image {
    background: linear-gradient(180deg, #E68F61 0%, #DF6336 48.08%, #DE5C35 100%);
    background-image: url('../img/evotor/evo_bg.png'), linear-gradient(180deg, #E68F61 0%, #DF6336 48.08%, #DE5C35 100%);
    background-size: 100% auto, cover;
    background-position: center;
    background-repeat: no-repeat;
}

#project-3 .project-card__content {
    position: relative;
    z-index: 1;
}

#project-3 a {
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#project-3 a:hover {
    border-bottom: 1px solid #FFFFFF;
}

#project-3 .credits {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
}

#project-3 .done {
    color: rgba(255, 255, 255, 0.9);
}


#project-2 .project-card__image {
    background-image: url('../img/qiwi/qiwi_bg.png'), linear-gradient(180deg, #F5F2EE 80%, #ECE9E8 100%);
    background-size: 100% auto, cover;
    background-position: center;
    background-repeat: no-repeat;
}

#project-2 .project-card__content {
    position: relative;
    z-index: 1;
}

#project-2 a {
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#project-2 a:hover {
    border-bottom: 1px solid #FFFFFF;
}

#project-2 .credits {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
}



#project-1 {
    position: relative;
    z-index: 1;
}

#project-1 .project-card__image {
    background-image: url('../img/megaplan/megaplan_bg.jpeg'), linear-gradient(180deg, #FAFDE9 0%, #FAFDE9 100%);
    background-size: 100%, cover;
    background-position: center top;
    background-repeat: no-repeat;
}

#project-1 .project-card__content {
    position: relative;
    z-index: 1;
}

#project-1 a {
    color: #7ab800;
    border-bottom: none;
}

#project-1 a:hover {
    border-bottom: none;
}

#project-1 .credits {
    color: rgba(0, 0, 0, 0.7);
    font-size: 0.7rem;
}

#project-1 .done {
    color: rgba(0, 0, 0, 0.9);
}

@media (max-width: 800px) {
    .projects-grid__row {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1rem;
    }
}

@media screen and (max-width: 800px) {
    .projects-grid__row {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    .project-card {
        margin-bottom: 1rem;
    }
    
    .project-card__image {
        margin-bottom: 0.25rem;
    }
}
