/* -----------------------

   Noha Stylesheet
   Simple Styling for nohanayel.art
   Author: Chuck Aligbe - www.chuck.aligbe.com

   -------------------- */

/* -----------------------
   Fonts
   -------------------- */

/* Figtree + Geist Mono Typefaces */
@import url("https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&family=Geist+Mono:wght@100..900&display=swap");

/* -----------------------
   Variables
   -------------------- */

:root {
    /* Turquoise: #0ac2c2 */
    --clr-turque-30: hsl(180 100% 80%);
    --clr-turque-40: hsl(180 100% 60%);
    --clr-turque-50: hsl(180 100% 40%);
    --clr-turque-60: hsl(180 100% 30%);
    --clr-turque-70: hsl(180 100% 20%);

    /* Royal: #0066cc */
    --clr-royal-30: hsl(210 100% 80%);
    --clr-royal-40: hsl(210 100% 60%);
    --clr-royal-50: hsl(210 100% 40%);
    --clr-royal-60: hsl(210 100% 30%);
    --clr-royal-70: hsl(210 100% 20%);

    /* Phthalo: #003636 */
    --clr-phthalo-30: hsl(180 100% 30%);
    --clr-phthalo-40: hsl(180 100% 20%);
    --clr-phthalo-50: hsl(180 100% 11%);
    --clr-phthalo-60: hsl(180 100% 8%);
    --clr-phthalo-70: hsl(180 100% 4%);

    /* Clement: #ffaa00 */
    --clr-clement-30: hsl(40 100% 80%);
    --clr-clement-40: hsl(40 100% 70%);
    --clr-clement-50: hsl(40 100% 50%);
    --clr-clement-60: hsl(40 100% 40%);
    --clr-clement-70: hsl(40 100% 30%);

    /* Tomate: #ffaa00 */
    --clr-tomate-30: hsl(10 100% 80%);
    --clr-tomate-40: hsl(10 100% 60%);
    --clr-tomate-50: hsl(5 100% 50%);
    --clr-tomate-60: hsl(7 100% 40%);
    --clr-tomate-70: hsl(8 100% 30%);

    /* Monochrome: #999999 */
    --clr-mono-30: hsl(0 0% 90%);
    --clr-mono-40: hsl(0 0% 80%);
    --clr-mono-50: hsl(0 0% 60%);
    --clr-mono-60: hsl(0 0% 40%);
    --clr-mono-70: hsl(0 0% 20%);

    /* Color Tokens */
    --clr-surface: var(--clr-mono-30);
    --clr-surface-alt: hsl(from var(--clr-phthalo-30) h s 95%);

    --clr-contrast: var(--clr-mono-70);
    --clr-contrast-alt: #666;

    --clr-primary: var(--clr-phthalo-50);
    --clr-primary-light: var(--clr-phthalo-30);
    --clr-primary-dark: var(--clr-phthalo-70);

    --clr-secondary: var(--clr-royal-50);
    --clr-secondary-light: var(--clr-royal-30);
    --clr-secondary-dark: var(--clr-royal-70);

    --clr-error: var(--clr-tomate-50);
    --clr-error-light: var(--clr-tomate-30);
    --clr-error-dark: var(--clr-tomate-70);

    --body-type: "Figtree", Inter, system-ui, Helvetica, Arial, sans-serif;
    --mono-type: "Geist Mono", ui-monospace, Monaco, Courier, monospace;

    /* Typography Tokens */
    --type-scale: 1.25;
}

/* -----------------------
   CSS Reset
   -------------------- */

/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
    margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
    html {
        interpolate-size: allow-keywords;
    }
}

body {
    /* 4. Add accessible line-height */
    line-height: 1.5;
    /* 5. Improve text rendering */
    -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input,
button,
textarea,
select {
    font: inherit;
}

/* 8. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
    text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root,
#__next {
    isolation: isolate;
}

/* -----------------------
   Global Styles
   -------------------- */

@view-transition {
    navigation: auto;
}

::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
    animation-duration: 0.25s;
    animation-fill-mode: forwards; /* important if you mix durations */
    animation-timing-function: ease;
}

html {
    font-size: 100%; /* Base font size */
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}
html:active-view-transition-type(forwards, backwards) {
    :root {
        view-transition-name: none;
    }
    .site-wrapper > #main {
        view-transition-name: site-main;
    }
}

body {
    background-color: hsl(0 0% 98%);
    color: #222;
    font-family: var(--body-type);
    font-size: 1.25rem;
}

header {
    margin-bottom: 2rem;
}

main,
section,
article {
    margin-bottom: 2rem;
}

:is(main, section, article) > *:last-child {
    margin-bottom: 0;
}

.site-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-wrapper > :is(header, footer) {
    width: 100%;
    flex: 0 0 auto;
}

.site-wrapper > main {
    width: 100%;
    flex: 2 0 auto;
}

header#header {
    padding-top: 2rem;
    padding-inline: 2rem;
    text-align: center;
}

#site-logo {
    text-decoration: none;
}

#site-logo > * {
    display: inline;
}

#site-logo img {
    width: 4rem;
    height: 4rem;
    margin-right: 1rem;
}

#site-logo h1 {
    font-size: 2rem;
    margin: 0;
    vertical-align: middle;
}

nav#site-nav {
    width: 100%;
    font-size: 1.25rem;
    padding-block: 1.5rem;
}

.nav-list,
nav > menu,
nav > .menu,
nav > [role="menu"] {
    list-style: none;
    display: flex;
    margin: 0;
    gap: 4px;
    padding: 0;
    justify-content: center;
    align-items: center;
}

nav#site-nav li {
    position: relative;
    padding: 0.25rem 1.25rem;
    text-transform: uppercase;
}

nav#site-nav li::after {
    position: absolute;
    display: block;
    content: "";
    background-color: var(--clr-royal-50);
    bottom: 0;
    left: 0;
    height: 0;
    width: 100%;
    transition: all 0.12s ease;
}

nav#site-nav li:hover::after,
nav#site-nav li:focus-within::after {
    height: 4px;
    opacity: 0.8;
}

nav#site-nav li.active::after {
    transition: none;
    height: 4px;
    opacity: 0.8;
}

nav#site-nav li a {
    text-decoration: none;
    outline: none;
}

.site-wrapper > main {
    max-width: min(50rem, 100% - 3rem);
    margin-inline: auto;
}

body#home .site-wrapper > main {
    max-width: 100%;
}

a {
    font-weight: bold;
    color: var(--clr-royal-50);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover,
a:focus {
    opacity: 0.75;
    text-decoration: underline;
}

footer#footer {
    margin-top: 2rem;
    min-height: 4rem;
    text-align: center;
    font-size: 0.8em;
}

@media screen and (min-width: 60rem) {
    body {
        font-size: 1.4rem;
    }

    header#header {
        text-align: left;
        display: grid;
        grid-template-columns: max-content 1fr;
        align-items: center;
    }

    .nav-list,
    nav > menu,
    nav > .menu,
    nav > [role="menu"] {
        justify-content: right;
    }
}

/* -----------------------
   Typography Styles
   -------------------- */

p {
    margin-block: 0 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--clr-contrast);
    margin-block: 0.5rem 1.5rem;
    line-height: 1.2;
    font-weight: 800;
}

h1 {
    font-size: calc(1rem * pow(var(--type-scale), 5));
}

h2 {
    font-size: calc(1rem * pow(var(--type-scale), 4));
}

h3 {
    font-size: calc(1rem * pow(var(--type-scale), 3));
}

h4 {
    font-size: calc(1rem * pow(var(--type-scale), 2));
}

h5 {
    font-size: 1.4rem;
}

h6,
.eyebrow {
    font-size: calc(1rem * var(--type-scale));
    text-transform: uppercase;
    color: var(--clr-turque-70);
}

blockquote {
    margin: 0.5rem;
    padding: 0 1rem;
    border-left: 4px solid var(--clr-contrast-alt);
}

ul,
ol {
    line-height: 2;
    padding-inline-start: 2.5rem;
}

:is(ul, ol) li {
    padding-inline-start: 0.25rem;
}

*:not(li, dt) > :where(dl, ul, ol, menu) {
    margin-bottom: 1rem;
}

dt {
    font-weight: bold;
}

dt:not(:first-of-type) {
    margin-block-start: 1rem;
}

dd {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-inline-start: 2.5rem;
}

hr {
    margin-block: 0.5rem;
    border: none;
    border-top: 2px solid var(--clr-mono-50);
}

samp,
pre,
code,
kbd {
    font-family: var(--mono-type);
}

caption,
figcaption,
.caption {
    font-size: 0.8em;
    font-style: italic;
}

@media screen and (min-width: 60rem) {
    :root {
        --type-scale: 1.4;
    }
}

/* -----------------------
   Image Styles
   -------------------- */

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle; /* Prevents extra space below image */
}

figure {
    max-width: 100%;
    margin-block: 1rem;
}

figure > img {
    margin-inline: auto;
}

figcaption {
    margin-block: 0.5rem;
    text-align: center;
}

/* -----------------------
   Homepage Styles
   -------------------- */

#header hr {
    max-width: min(25rem, 100% - 8rem);
    margin-inline: auto;
}

.two-cols .col:first-of-type {
    margin-bottom: 2rem;
}

section > .container {
    max-width: min(50rem, 100%);
    margin-inline: auto;
}

#hero {
    padding: 2rem;
    height: 80vh;
    background-color: hsl(0 0% 20% / 0.4);
    background-image: url("/static/media/noha-cherry-blossoms-ii.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-blend-mode: multiply;
}

#hero .container {
    display: flex;
    height: 100%;
    flex-direction: column;
    justify-content: center;
}

#hero h2 {
    font-size: calc(4rem * var(--type-scale));
    margin-block: 0.5rem;
    color: var(--clr-mono-30);
}

#hero .subheading {
    font-size: calc(1.5rem * var(--type-scale));
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: var(--clr-mono-40);
}

#about {
    padding: 3rem 1.5rem;
    scroll-margin-block: 4rem;
    font-size: calc(1.5rem * var(--type-scale));
}

#works {
    padding: 3rem 1.5rem;
    text-align: center;
    background-color: hsl(from var(--clr-phthalo-30) h 20 90);
    font-size: calc(1.25rem * var(--type-scale));
}

#works img {
    margin: 2rem 0;
}

#contact {
    display: grid;
    align-items: center;
    min-height: 80vh;
    padding: 3rem 1.5rem;
    scroll-margin-block: 4rem;
    font-size: calc(1.25rem * var(--type-scale));
}

#contact > .container {
    width: 100%;
}

@media screen and (min-width: 60rem) {
    .two-cols {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .col:has(:not(img)) {
        padding: 2rem;
    }
}

/* -----------------------
   Page Styles
   -------------------- */

.page-header {
    text-align: center;
}

.section-header {
    margin-bottom: 3rem;
}

.section-header :is(h1, h2, h3, h4, h5, h6) {
    margin-block: 0.5rem;
}

.section-header .tagline {
    font-style: italic;
    color: var(--clr-phthalo-40);
}

span.side-scroll {
    display: none;
    opacity: 0;
}

figure.gallery--item {
    margin-bottom: 3rem;
}

@media screen and (min-width: 60rem) {
    #work .site-wrapper > main {
        max-width: calc(100% - 3rem);
    }

    span.side-scroll {
        display: inline;
        opacity: 1;
    }

    .gallery {
        height: 80vh;
        overflow-x: scroll;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        white-space: nowrap;
        margin-bottom: 1rem;
        overscroll-behavior-x: contain;
    }

    figure.gallery--item {
        display: inline-block;
        max-width: none;
        height: calc(100% - 3rem);
        margin: 0 1.5rem 2rem 0;
        scroll-snap-align: center;
    }

    figure.gallery--item figcaption {
        text-align: left;
    }

    figure.gallery--item:last-of-type {
        margin-right: 0;
    }

    .gallery--item img {
        max-width: none;
        height: 100%;
    }
}

/* -----------------------
   Posts Styles
   -------------------- */

ul#articles {
    padding: 1rem 0rem;
    list-style: none;
}

#articles li {
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.125rem;
    border-bottom: 2px dotted var(--clr-mono-50);
    margin-bottom: 0.5rem;
}

#articles li .date {
    color: var(--clr-mono-50);
}

.article-header {
    margin-bottom: 3rem;
}

.article-header :is(h1, h2, h3, h4, h5, h6) {
    margin-block: 0.5rem;
}

.article-header .meta {
    color: var(--clr-mono-50);
    font-style: italic;
}

.article-footer {
    color: var(--clr-mono-50);
    font-style: italic;
    text-align: right;
    margin-block: 2rem;
}

article.post figure:not(:first-child) {
    margin-block: 2rem;
}

/* -----------------------
   Lightbox Styles
   -------------------- */

.tobii button {
    min-width: unset;
    margin: 0;
    padding: 0;
}

.tobii button.tobii__btn--close {
    margin: 0.5rem;
}

.tobii .tobii__slider--animate {
    --tobii-transition-duration: 0.8s;
}
