@charset "utf-8";

/**
  * set all elements box-sizing property to border-box and border-radius of 3px
  */
*,
*:before,
*:after {
    box-sizing: border-box;
    border-radius: 3px;
}

/**
    * set colors to custom properties
    */
:root {
    --white: #fff;
    --black: #000;
    --color-invalid: #ff8624;
    --color-invalid-text: #751a1a;
    --color-text: #e7c8e7;
    --color-highlight: #4c2f6f;
    --color-wrapper: #52489f;
    --color-border: #0d0b33;
    --color-image-cta: #c266a7;
    --color-link: #09201b;
    --color-hover: #f1c6e5;
}

/**
* Set universal link styles
*/
a {
    text-decoration: none;
}

a:link,
a:visited {
    color: var(--color-link);
}

a:hover {
    color: var(--color-hover);
}

/**
* Set button of active page to be different color
*/
#nav-main-menu .active {
    background-color: var(--color-hover);
    text-decoration: underline;
}

/**
    * set the min-height to 100dvh
    */
html {
    font-family: "Funnel Sans", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: 18px;
    min-height: 100dvh;
    scroll-behavior: smooth;
}

/**
    * body
    */
/* prettier-ignore */
body {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    justify-items: center;
    background-image: radial-gradient(var(--color-wrapper), var(--color-highlight));
}

/**
    * content wrapper
    */
.wrapper {
    margin: 0 auto;
    width: 100%;
    background-color: var(--color-wrapper);
    padding: 20px;
    display: grid;
    gap: 20px;
    opacity: 0.9;
    overflow: hidden;
}

/**
* Headings font styling
*/
h1 {
    font-family: "Aref Ruqaa", serif;
    font-weight: 700;
    font-style: normal;
    font-size: 2.75em;
}

h2 {
    font-family: "Aref Ruqaa", serif;
    font-weight: 700;
    font-style: normal;
    font-size: 2.0625em;
    margin: 0;
}

h3 {
    font-family: "Aref Ruqaa", serif;
    font-weight: 700;
    font-style: normal;
    font-size: 1.375em;
    margin: 0;
}

/**
* Header
*/
header {
    background-color: var(--color-text);
    display: flex;
    justify-content: center;
    padding: 0 10px 0 10px;
}

header h1 {
    text-align: center;
    margin: 0;
    margin: 20px 0 20px 0;
}

/**
* Aside
*/
aside {
    background-color: var(--color-text);
    padding: 10px;
}

/**
* Style asides specifically with pictures
*/
.data-transfer .pic,
.parts-site .pic,
.web-coding .pic,
.error-page aside {
    background-color: var(--color-image-cta);
    display: flex;
    align-items: center;
    justify-content: center;
}

aside img {
    width: 100%;
}

aside a {
    line-height: 0;
}

/**
* Style code asides
*/
.code {
    display: grid;
    grid-template-rows: auto 1fr;
    background-color: var(--color-image-cta);
}

.code h2 {
    text-align: center;
}

/**
    * navigation
    */
.nav-main {
    position: absolute;
    background-color: var(--color-highlight);
    border-right: 5px solid var(--color-wrapper);
    border-bottom: 5px solid var(--color-wrapper);
    top: 0;
    left: 0;
    z-index: 9999;
    line-height: 0;
}

.nav-main-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 0;
}

/* SET SVG TRANSFORMS - based on individual elements not SVG box */
.nav-main-menu-toggle svg * {
    transform-box: fill-box;
}

svg .bar {
    fill: none;
    stroke: var(--color-hover);
    stroke-width: 4;
    stroke-linecap: square;
    transition: stroke-dasharray 400ms, stroke-dashoffset 400ms;
}

/* HAMBURGER MENU ICON */
.nav-main-menu-toggle path:nth-child(1) {
    stroke-dasharray: 40 172;
}

.nav-main-menu-toggle path:nth-child(2) {
    stroke-dasharray: 40 111;
}

.nav-main-menu-toggle path:nth-child(3) {
    stroke-dasharray: 40 172;
}

.nav-main-menu-toggle[aria-expanded="true"] path:nth-child(1) {
    stroke-dashoffset: -132px;
}

.nav-main-menu-toggle[aria-expanded="true"] path:nth-child(2) {
    stroke-dashoffset: -71px;
}

.nav-main-menu-toggle[aria-expanded="true"] path:nth-child(3) {
    stroke-dashoffset: -132px;
}
/* END - .nav-main-menu-toggle */

/**
* Styling of list of links
*/
#nav-main-menu {
    position: absolute;
    background: var(--color-image-cta);
    width: 0vw;
    height: 0vh;
    transform: translateX(-200%);
    overflow: hidden;
    visibility: hidden;
    transition: 0.8s ease-out;
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 0;
    gap: 5px;
    margin: 0;
}

#nav-main-menu:not([hidden]) {
    visibility: visible;
    transform: translateX(0);
    width: 100vw;
    height: 100vh;
    transition: 0.4s ease-out;
}

#nav-main-menu li:first-child {
    margin-top: 5px;
}

#nav-main-menu li a {
    display: flex;
    line-height: 3;
    padding: 0 2em;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

#nav-main-menu li a:hover,
#nav-main-menu li a:focus {
    background-color: transparent;
    border: 2px solid var(--color-image-cta);
}

#nav-main-menu li a:active {
    transition: none;
    border: 2px solid transparent;
}

/**
* Paragraph
*/
p {
    line-height: 1.5;
    max-width: 60ch;
}

/**
* Make colors go to edge of wrapper when needed
*/
#bleed-color {
    background-color: var(--color-text);
}

/**
* Give spacing to elements on content pages
*/
.data-transfer h2,
.parts-site h2,
.web-coding h2,
.error-page h2,
.data-transfer h3,
.parts-site h3,
.web-coding h3 {
    padding-left: 10px;
    padding-right: 10px;
}

.data-transfer p,
.parts-site p,
.web-coding p,
.error-page p {
    background-color: var(--color-text);
    padding: 10px;
    margin: 0;
}

/**
* Mains
*/
.main main {
    display: flex;
}

.error-page main {
    display: grid;
    align-items: center;
}

/**
    * cards
    */
.icon {
    width: 1em;
    height: 1em;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    justify-content: space-between;
    margin: 0;
    flex-grow: 1;
}

.cards .card {
    flex: 0 0 100%;
    display: flex;
    min-width: 0;
    background: var(--color-image-cta);
    margin-bottom: 20px;
    border: 2px solid var(--color-border);
}

.cards .card:last-child {
    margin: 0;
}

.cards .card-link {
    color: inherit;
    display: flex;
    flex-wrap: wrap;
    flex: 0 0 100%;
    transition: all 0.3s ease-out;
}

.cards .card-link:hover {
    transform: translate(-7px, -7px);
    box-shadow: 7px 7px 0 var(--color-image-cta);
}

.cards .card-figure {
    position: relative;
    margin: 0;
    line-height: 0;
    overflow: hidden;
    width: 50%;
    display: flex;
}

.cards .card-figure-image {
    width: 100%;
    object-fit: cover;
    margin: 0;
}

.cards .card-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--color-text);
    width: 50%;
}

.cards .card-section-title {
    text-align: center;
    font-size: clamp(1em, 5vw, 1.35em);
}

figure {
    margin: 0;
}

/**
* Form errors
*/
.error {
    color: var(--color-invalid-text);
    display: block;
}

.contact-form .error-parent {
    background-color: var(--color-invalid);
    padding: 5px;
}

.contact-form #form .error-parent:nth-child(2),
.contact-form #form .error-parent:nth-child(3) {
    margin-top: 10px;
}

/**
* Form elements
*/
label {
    display: flex;
}

input {
    height: 40px;
    width: 100%;
}

.button {
    background: var(--color-image-cta);
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.button:hover,
.button:focus {
    background-color: var(--color-highlight);
    color: var(--color-hover);
    border: 3px solid var(--color-image-cta);
}

.button:active {
    transition: none;
    border: 3px solid transparent;
}

form :is(input, select, textarea) {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

fieldset {
    width: 100%;
    margin: 0;
    padding: 10px 10px 20px 10px;
    border-color: var(--color-border);
}

fieldset:has(.submit) {
    display: grid;
    justify-content: center;
}

/**
* Sizing textarea
*/
#message {
    width: 100%;
    min-height: 300px;
}

/**
* Styling specific cases on form page
*/
.contact-form main {
    padding: 10px;
}

.contact-form p {
    max-width: 500ch;
    margin: 0;
    line-height: 2;
}

#names p:nth-child(2) {
    margin-top: 20px;
}

.contact-form p:nth-child(3) {
    margin-top: 20px;
}

/**
    * footer
    */
footer {
    background-color: var(--color-highlight);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 5px;
}

/**
    * footer navigation
    */
footer a {
    display: flex;
    line-height: 2;
    padding: 0 0.5em;
    background-color: var(--color-image-cta);
    transition: all 0.3s ease;
    margin: auto 0;
    border: 2px solid transparent;
}

footer a:nth-child(2) {
    margin-right: auto;
}

footer a:hover,
footer a:focus {
    background-color: transparent;
    border: 2px solid var(--color-image-cta);
}

footer a:active {
    transition: none;
    border: 2px solid transparent;
}

@media (min-width: 768px) {
    /**
    * Set grid layout for bigger devices
    */
    .wrapper {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
    }

    header {
        grid-column: 4 / span 6;
    }

    nav {
        grid-column: 2 / span 10;
    }

    main {
        grid-column: span 8;
    }

    .main main {
        grid-column: span 6;
    }

    .contact-form main {
        width: 100%;
        display: grid;
        justify-items: center;
    }

    .contact-form #form .error-parent {
        padding: 10px;
    }

    .contact-form #form .error-parent:nth-child(2) {
        margin-top: 0px;
    }

    .web-coding #bleed-color,
    .parts-site #bleed-color,
    .data-transfer #bleed-color,
    .contact-form #bleed-color {
        grid-column: span 12;
    }

    #bleed-color {
        grid-column: 5 / span 8;
        display: flex;
        justify-content: center;
    }

    aside {
        grid-column: span 4;
    }

    .main aside {
        grid-column: span 6;
    }

    .web-coding .pic,
    .data-transfer .pic,
    .parts-site .pic {
        grid-column: 3 / span 8;
    }

    form {
        width: 100%;
        display: grid;
        justify-items: center;
    }

    input {
        width: auto;
    }

    #email {
        width: 100%;
    }

    #names {
        display: flex;
        justify-content: space-evenly;
    }

    #names p:nth-child(2) {
        margin-top: 0px;
    }

    .code {
        grid-column: span 12;
    }

    footer {
        grid-column: 2 / span 10;
    }

    /**
    * Remove hamburger menu and use bar style instead
    */
    .nav-main {
        position: static;
        z-index: auto;
        padding: 5px 0 5px 0;
        border: none;
    }

    .nav-main-menu-toggle {
        display: none;
    }

    #nav-main-menu {
        position: static;
        visibility: visible;
        transform: translateX(0);
        transition: none;
        background: transparent;
        display: flex;
        flex-direction: row;
        width: auto;
        height: auto;
        gap: 10px;
        justify-content: center;
    }

    #nav-main-menu li:first-child {
        margin-top: 0;
    }

    #nav-main-menu li a {
        background-color: var(--color-image-cta);
        line-height: 2;
        padding: 0 0.5em;
    }
}

@media (min-width: 1025px) {
    /**
    * Make all pages the same width with scroll bar
    */
    html {
        overflow-y: scroll;
    }

    /**
      * set max width on content wrapper
      */
    .wrapper {
        position: relative;
        width: 1015px;
        overflow: visible;
    }

    /**
      * header
      */
    /* prettier-ignore */
    header {
        position: relative;
    }

    /**
    * Size form to be smaller on desktop
    */
    form {
        width: 80%;
    }
}