:root {
    --backcolor: #eee;
    --text-color: #1f1f1f;
    --card-color: #fcfaf3;
    --border-color: #4d4d4d;
    --navi-color: #4d4d4d;
    --navi-hover-color: #808080;
    --navi-hover-tooltip: #000000cc;
    --shadow-colour: #00000070;
    --heading1-colour: #f352c8;
    color-scheme: light;
}
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.45s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(root) {
    animation-name: page-exit;
}

::view-transition-new(root) {
    animation-name: page-enter;
}

@keyframes page-exit {
    to {
        opacity: 0;
        transform: translateY(-12px) scale(0.985);
    }
}

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }
}

body.is-leaving {
    opacity: 0;
    transform: translateY(-12px) scale(0.985);
    transition: opacity 0.32s ease, transform 0.32s ease;
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 0.01ms;
    }

    body.is-leaving {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

[data-theme="dark"] {
    --backcolor: #17191c;
    --text-color: #f1f3f5;
    --card-color: #24282d;
    --border-color: #aab2bc;
    --navi-color: #d9dee5;
    --navi-hover-color: #ffffff;
    --navi-hover-tooltip: #000000e6;
    --shadow-colour: #000000aa;
    --heading1-colour: #de73d7;
    color-scheme: dark;
}


body {
    font-family: "Lexend", "Noto Sans JP", sans-serif;
    background-color: var(--backcolor);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.25s, color 0.25s;
}

#dot-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/** ------ outer margin settings ------**/
*, *::before, *::after {
    box-sizing: border-box;
}

section:first-child {
    padding: 0;
    position: relative;
}

.display-name {
    text-align: left;
}

.display-name > h1:first-child {
    margin: 0 0 18px;
}

.display-name > h1:first-child img {
    display: block;
    width: clamp(80px, 12vw, 140px);
    height: auto;
    margin: 0 auto;
}

section {
    padding: 30px 50px;
}

/** ------ heading style ------ **/
h1 {
    font-size: 3rem;
}

.display-me img {
    width: clamp(120px, 20vw, 200px);
}

.dname-heading h1:first-child:after {
    content: "\00A0/\00A0";
    white-space: pre;
}

.dname-heading {
    display: flex;
}

.display-me {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    min-height: 100%;
}

h2 {
    font-size: 2rem;
}

.tables h3 {
    font-size: 1.5rem;
}

.tables h4 {
    font-size: 1.2rem;
}

/** ------ scroll logic ------ **/
main {
    position: relative;
    z-index: 1;
    scroll-behavior: smooth;
    width: 100%;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
}

.area {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
}

#products {
    min-height: 100vh;
    height: auto;
}

#lang-env {
    min-height: 100vh;
    height: auto;
}

.area:last-child {
    position: relative;
    display: grid;
    place-items: end center;
    overflow: hidden;
}

#easter-egg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: none !important;
}

.area:last-child small {
    position: relative;
    z-index: 1;
    margin-bottom: 30px;
}

.footer {
    margin-top: 100px;
}

/** ------ secret page ------ **/
.secret-page {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.secret-page small {
    position: absolute;
    bottom: 30px;
}

.secret-back {
    position: absolute;
    top: 30px;
    left: 50px;
    color: inherit;
    text-decoration: none;
    opacity: 0.65;
    transition: opacity 0.2s, transform 0.2s;
}

.secret-back:hover,
.secret-back:focus-visible {
    opacity: 1;
    transform: translateX(-4px);
}

.secret-kicker {
    margin: 0 0 12px;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.6;
}

.secret-intro h1 {
    margin: 0;
    color: var(--heading1-colour);
}

.secret-copy {
    margin: 12px 0 0;
}

.algorithm-wrap {
    width: min(680px, 100%);
    z-index: 1;
}

.algorithm-picker {
    display: flex;
    width: fit-content;
    margin: 0 auto 12px;
    border: 1px solid var(--border-color);
}

.algorithm-choice {
    border: 0;
    border-right: 1px solid var(--border-color);
    padding: 8px 12px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.8rem;
    transition: background-color 0.2s, color 0.2s;
}

.algorithm-choice:last-child {
    border-right: 0;
}

.algorithm-choice.is-selected,
.algorithm-choice:hover,
.algorithm-choice:focus-visible {
    background: var(--text-color);
    color: var(--backcolor);
}

#algorithm-canvas {
    display: block;
    width: 100%;
    height: min(48vh, 380px);
    border: 1px solid color-mix(in srgb, var(--border-color) 35%, transparent);
    background: color-mix(in srgb, var(--card-color) 42%, transparent);
    touch-action: none;
}

.algorithm-status {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    font-size: 0.8rem;
    opacity: 0.7;
}

.algorithm-controls {
    display: flex;
    gap: 12px;
    z-index: 1;
}

.algorithm-button {
    z-index: 1;
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 10px 16px;
    background: transparent;
    color: inherit;
    font: inherit;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.algorithm-button:hover,
.algorithm-button:focus-visible {
    background: var(--text-color);
    color: var(--backcolor);
    transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
    .secret-back,
    .algorithm-button {
        transition: none;
    }

    .algorithm-choice {
        transition: none;
    }
}

/** ------ dot navigation ------ **/
.dot-nav {
    position: fixed;
    top: 50%;
    right: 50px;
    transform: translateY(-50%);
    z-index: 1000;
}

.dot-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.dot-nav li {
    position: relative;
    padding: 10px;
    display: block;
}

.dot-nav a {
    display: inline-block;
    background-color: var(--navi-color);
    width: 7px;
    height: 7px;
    border-radius: 0%;
    transition: transform 0.2s, background-color 0.2s;
}

.dot-nav a:hover,
.dot-nav a.is-active {
    background-color: var(--navi-hover-color);
    transform: scale(1.35);
}

.dot-nav a::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--navi-hover-tooltip);
    color: #fff;
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}

.dot-nav a:hover::before,
.dot-nav a.is-active::before {
    opacity: 1;
    visibility: visible;
}

/** ------ sns list ------ **/
.snses img {
    width: 50px;
    transition: filter 0.25s ease;
}

[data-theme="dark"] .snses img {
    filter: invert(1) brightness(0.86);
}

[data-theme="dark"] .snses img.no-theme-filter {
    filter: none;
}

.snses > *:last-child img {
    width: 100px;
}

.sns-list ul{
    width: min(100%, 900px);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 48px clamp(32px, 8vw, 100px);
    margin: 0 auto;
    padding: 0;
}

.snses li {
    list-style: none;
}

.snses a {
    text-decoration: none;
    display: block;
    color: inherit;
}

.sns-list-sec {
    display: flex;
    align-items: center;
    justify-content: center;
}

/** ------ contact form ------ **/
.contact-area {
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-inner {
    width: min(100%, 680px);
}

.contact-inner > p {
    margin: -12px 0 36px;
}

.contact-form {
    display: grid;
    gap: 24px;
    padding: 36px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.contact-form label {
    display: grid;
    gap: 8px;
    font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 12px 14px;
    background: var(--card-color);
    color: var(--text-color);
    font: inherit;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.25s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--text-color);
    box-shadow: 4px 4px 0 var(--shadow-colour);
}

.contact-form button {
    justify-self: end;
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 11px 18px;
    background: var(--text-color);
    color: var(--backcolor);
    font: inherit;
    transition: opacity 0.2s, transform 0.2s;
}

.contact-form button span {
    display: inline-block;
    margin-left: 8px;
    transition: transform 0.2s;
}

.contact-form button:hover,
.contact-form button:focus-visible {
    opacity: 0.78;
}

.contact-form button:hover span,
.contact-form button:focus-visible span {
    transform: translateX(4px);
}

/** ------ table style ------ **/
table {
    table-layout: fixed;
    width: 60%;
    border-collapse: collapse;
}

th, td {
    padding: 0.5em;
    text-align: center;
}

/** ------ card style ------**/
.card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 30px;
}

.card {
    display: block;
    text-decoration: none;
    color: inherit;
    background-color: var(--card-color);
    width: min(350px, 100%);
    height: 400px;
    border-radius: 5px;
    border: 2px solid var(--border-color);
    text-align: center;
    transition: .2s;
}

.card img {
    margin-top: 5%;
    width: 90%;
}

.more {
    display: flex;
    justify-content: center;
    align-items: center;
}

/** ------ language icons ------ **/
.lang-icon-list {
    text-align: center;
}

i {
    font-size: 90px;
    margin: 0 40px 20px 0;
}
i:last-child {
    margin: 0;
}

/** ------ kinds of styles ------ **/
section {
    text-align: center;
}

table {
    margin: auto;
    margin-bottom: 100px;
}

.intro {
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-inner {
    text-align: center;
    width: min(100%, 1800px);
}

.intro .airtable-embed {
    display: block;
    width: 40%;
    max-width: 100%;
    height: min(500px, 70vh);
    margin: 0 auto;
    zoom: 0.8 !important;
}


.intro table {
    margin-bottom: 48px;
}

.env-topmargin {
    margin-top: 100px;
}

a.easter-egg-link {
    color: var(--heading1-colour);
}

/** ------ custom cursor ------ **/
*, *::before, *::after {
    cursor: none !important;
}

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 2px dotted var(--text-color);
    pointer-events: none;
    z-index: 9999;
    transition: width 0.2s, height 0.2s, border-radius 0.2s;
    border-radius: 50%;
}

.theme-toggle {
    position: absolute;
    top: 24px;
    right: 44px;
    z-index: 2;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: transparent;
    display: grid;
    place-items: center;
    opacity: 0.62;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s, transform 0.2s;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background-color: transparent;
    border-color: var(--navi-color);
    outline: 2px solid var(--navi-color);
    outline-offset: 2px;
    opacity: 1;
    transform: scale(1.05);
}

.theme-toggle::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background-color: var(--text-color);
    transition: background-color 0.2s, transform 0.2s;
}

[data-theme="dark"] .theme-toggle::before {
    transform: translateX(-1px);
}

[data-theme="dark"] .theme-toggle::after {
    content: "";
    position: absolute;
    inset: 2px 1px 7px 8px;
    border-radius: 50%;
    background-color: var(--backcolor);
}


@media (max-width: 768px) {
    section {
        padding: 24px 16px;
    }

    .area {
        min-height: 100vh;
        height: auto;
    }

    .display-name {
        width: auto;
    }

    .display-me {
        min-height: 100vh;
    }

    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.65rem;
    }

    .dname-heading {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .dot-nav {
        right: 8px;
    }

    .dot-nav ul {
        gap: 12px;
    }

    .dot-nav li {
        padding: 9px;
    }

    .dot-nav a::before {
        right: 18px;
        font-size: 11px;
    }

    .sns-list {
        width: 100%;
    }

    .sns-list ul {
        gap: 32px 24px;
    }

    .card-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card {
        margin: auto;
    }

    .lang-icon-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px 24px;
    }

    i,
    i:last-child {
        margin: 0;
        font-size: 64px;
    }

    .tables {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow-x: auto;
    }

    table {
        width: max-content;
        min-width: 100%;
        margin-bottom: 48px;
    }

    th,
    td {
        padding: 0.45em;
        white-space: nowrap;
    }

    .intro-inner {
        width: 100%;
    }

    .intro .airtable-embed {
        display: block;
        width: 100%;
        max-width: 100%;
        height: min(500px, 70vh);
        margin: 0 auto;
        zoom: 0.8 !important;
    }

    .intro {
        overflow-x: hidden;
    }

    .contact-area {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .contact-inner > p {
        margin-bottom: 28px;
    }

    .contact-form {
        padding: 24px 20px;
    }

    .area:last-child {
        min-height: 100vh;
    }

    .area:last-child small {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .display-me {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .display-name {
        text-align: center;
    }

    .dname-heading {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    #lang-env .tables {
        overflow: visible;
    }

    #lang-env table {
        display: block;
        width: 100%;
        min-width: 0;
    }

    #lang-env thead {
        display: none;
    }

    #lang-env tbody,
    #lang-env tr {
        display: block;
    }

    #lang-env tr {
        border-top: 1px solid var(--border-color);
    }

    #lang-env td {
        display: grid;
        grid-template-columns: minmax(7em, 38%) minmax(0, 1fr);
        gap: 12px;
        padding: 0.65em 0;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    #lang-env td::before {
        content: attr(data-label);
        font-weight: 600;
    }
}

@media (max-width: 768px) {
    #person table {
        display: block;
        width: 100%;
        min-width: 0;
    }

    #person thead {
        display: none;
    }

    #person tbody,
    #person tr {
        display: block;
    }

    #person tr {
        border-top: 1px solid var(--border-color);
    }

    #person td {
        display: grid;
        grid-template-columns: minmax(7em, 38%) minmax(0, 1fr);
        gap: 12px;
        padding: 0.65em 0;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    #person td::before {
        content: attr(data-label);
        font-weight: 600;
    }
}

@media (hover: none), (pointer: coarse) {
    *,
    *::before,
    *::after {
        cursor: auto !important;
    }

    .custom-cursor {
        display: none;
    }

    .dot-nav a.is-active::before {
        opacity: 0;
        visibility: hidden;
    }
}

