/* Reset */
html,
body,
p,
ol,
ul,
li,
dl,
dt,
dd,
blockquote,
figure,
fieldset,
legend,
textarea,
pre,
iframe,
hr,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: 100%;
  font-weight: normal;
}

ul {
  list-style: none;
}

button,
input,
select,
textarea {
  padding: 0;
  margin: 0;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

html {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

img,
video {
  display: block;
  height: auto;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

/* globals */
html {
    font-size: 16px;
    height: 100%;
}

body {
    width: 100%;
    height: 100%;
    word-break: keep-all;
}

.main {
    width: 100%;
    height: 100%;
}

.section {
    display: flex;
    flex-direction: column;
}

/* style */
:root {
    --book-width: 800px;
    --book-height: 600px;
}

#webbook {
    touch-action: none;
}

#webbook .section {
    width: 100%;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0c209e;
    perspective: 3000px;
}

.book {
    position: relative;
    width: var(--book-width);
    height: var(--book-height);
    transform-style: preserve-3d;
    transform: rotateX(20deg);
    transform-origin: center center;
}

@media screen and (max-width: 900px) {
    #webbook .section {
        perspective: 5000px;
    }

    .book {
        transform: rotateX(20deg) scale(0.8);
    }
}

@media screen and (max-width: 700px) {
    #webbook .section {
        perspective: 7000px;
    }

    .book {
        transform: rotateX(20deg) scale(0.6);
    }
}

@media screen and (max-width: 500px) {
    #webbook .section {
        perspective: none;
    }

    .book {
        transform: rotateX(30deg) scale(0.4);
    }
}

.leaf {
    position: absolute;
    left: calc(var(--book-width) / 2);
    width: 50%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 2s ease-out;
    cursor: pointer;
    transform: rotateY(0deg);
    transform-origin: left;
}

.leaf.flipped {
    transform: rotateY(-180deg);
    transform-origin: left;
}

.page {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;

    font-family: 'Gothic A1', serif;

    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    backface-visibility: hidden;
}

.page.front {
    left: 0;
    background: linear-gradient(90deg, #555, #aaa 3%, #fff);
}

.page.back {
    left: 0;
    transform: rotateY(180deg);
    background: linear-gradient(270deg, #555, #aaa 3%, #fff);
}

.page-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
    user-select: none;
}

.page.front .page-content {
    padding: 1rem 1rem 1rem 1.75rem;
}

.page.back .page-content {
    padding: 1rem 1.75rem 1rem 1rem;
}

.page-content.image {
    justify-content: center;
    align-items: center;
}

.page.front .page-content.image, .page.back .page-content.image {
    padding: 4rem;
}

.page-content.overflow {
    overflow-y: auto;
}

.page-content .en {
    position: relative;
    font-size: 1.25rem;
    top: 0.05rem;
}

.page-content a {
    color: blue;
    text-decoration: underline;
}

.page-content h1 {
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.4;
}

.page-content p {
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.4;
}