/* 
 * Thanks to Karen Ying for the hamburger-menu-to-x animation
 * (https://codepen.io/karenying) 
 */

@font-face {
	font-display: swap;
    font-family: "Hiragino Maru Gothic Pro";
    src: url("fonts/HiraMaruProN-W4-AlphaNum-01.otf");
}

@font-face {
	font-display: swap;
    font-family: "Hina Mincho";
    src: url("fonts/HinaMincho-Regular.ttf");
}

@font-face {
	font-display: swap;
    font-family: "Arial Rounded Bold";
    src: url("fonts/Arial-Rounded-Bold.ttf");
}

@font-face {
	font-display: swap;
    font-family: CCSymbols;
    src: url("fonts/CCSymbols.ttf");
}

@font-face {
	font-display: swap;
    font-family: "Gen Sen Maru Gothic";
    src: url("fonts/GenSenRounded2TW-M.otf");
}

:root {
	--main-bg-color: #f2db0f;
	--main-font-color: #191b2d;

	--drawer-width: 40vw;
	--header-height: 85px;

	--ja-p: 1.2rem;
	--ja-h1: 1.5rem;
	--ja-h2: 1.8rem;

	--en-p: 1.3rem;
	--en-h1: 1.5rem;
	--en-h2: 1.8rem;

	--zh-p: 1.2rem;
	--zh-h1: 1.5rem;
	--zh-h2: 1.8rem;

	--splash: clamp(3rem, 1.004rem + 8.5161vw, 7.125rem);
}

:lang(ja) {
	--font-heading: "Hiragino Maru Gothic Pro", sans-serif;
	--font-serif: "Hina Mincho", serif;

	line-break: strict;

	p {
		font-size: var(--ja-p);
	}

	h1 {
		font-size: var(--ja-h1);
	}

	h2 {
		font-size: var(--ja-h2);
	}
}

:lang(en) {
	--font-heading: "Arial Rounded Bold", sans-serif;
	--font-serif: "Hina Mincho", serif;

	p {
		font-size: var(--en-p);
	}

	h1 {
		font-size: var(--en-h1);
	}

	h2 {
		font-size: var(--en-h2);
	}
}

:lang(zh) {
	--font-heading: "Hiragino Maru Gothic Pro", sans-serif;
	--font-serif: "Gen Sen Maru Gothic", serif;

	line-break: strict;

	p {
		font-size: var(--zh-p);
	}

	h1 {
		font-size: var(--zh-h1);
	}

	h2 {
		font-size: var(--zh-h2);
	}
}

/* Prevent links from turning purple when visited. */
a:visited {
	color: blue;
}

/* Icon for external links. */
a[href^="http"]:not([href*="rokyo.info"])::after {
	content: "↗";
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
}

p {
	font-family: var(--font-serif);
}

html {
    box-sizing: border-box;
	font-size: 16px;
}

html:lang(ja) {

}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    background-color: var(--main-bg-color);
    color: var(--main-font-color);
    margin: 0 auto;
	/* padding: 0 30px; */
}

/* Drawer menu */
.mobile-drawer {
	background: var(--main-bg-color);
	box-shadow: inset 5px 5px 10px rgba(0,0,0,0.2);
	color: var(--main-font-color);
	height: 100%;
	padding: 1rem;
	position: fixed;
		right: 0;
		top: var(--header-height);
	transform: translateX(100%);
	transition: transform 0.3s ease;
	text-align: center;
	width: var(--drawer-width);
	z-index: 1000;
}

/* Slide drawer over */
.mobile-drawer.open {
	transform: translateX(0);
}

.slide-content {
	transition: transform 0.3s ease;
}

/* Slide site content over */
.slide-content.slide {
	transform: translateX(calc(-1 * var(--drawer-width)));
}

.mobile-drawer {
	ul {
		display: inline-flex;
		align-items: flex-start;
		flex-direction: column;
		font-family: var(--font-heading);
		margin: 0;
		padding: 0;
		width: 100%;
	}
	ul a {
		color: inherit;
		text-decoration: none;
		width: 100%;
		padding: 5px;
	}

	ul a:hover {
		background-color: rgb(100 100 100 / 20%);
		border-radius: 5px;
	}

	li {
		align-content: center;
		font-size: 1.2rem;
		list-style: none;
		margin: 0.5rem 0;
		text-decoration: underline 2px;
		width: 100%;
	}
}

.main-grid {
    background-color: var(--main-bg-color);
    color: var(--main-font-color);
    display: grid;
		gap: 0;
		grid-template-columns: 
			minmax(50px, 0.5fr) 
			minmax(auto, 1000px) 
			minmax(50px, 0.5fr);
		grid-template-rows: auto 1fr auto;
    margin: 0;
    min-height: 100vh;
	z-index: 0;
}

header {
	grid-column: 1 / -1;
}

main {
	grid-column: 2 / 3;
}

footer {
	grid-column: 2 / 3;
}

header {
    background: inherit;
    color: inherit;
	display: grid;
		grid-template-columns: inherit;
	min-width: 300px;
    padding: 5px 0 1rem 0;
    position: sticky;
		top: 0;
	z-index: 1002; /* header above drawer */
}

.language-select-wrapper {
	grid-column: 2 / 3;
	position: absolute;
	right: 1.1rem;
	top: 5px;
	z-index: 1003; /* lang-sel above header */
}

.header-content {
	grid-column: 2 / 3;
	display: flex;
	max-width: 1000px;
	position: relative;
}

.logo {
    display: flex;
		align-items: center;

	a {
		line-height: 0;
	}

	img[src="logoidea2.png"] {
		display: block;
		height: 64px;
		margin: 0 0.5rem;
		object-fit: contain;
		padding: 0 0 0 0;
	}
}

.header-content h1 {
    font-family: "Hiragino Maru Gothic Pro", sans-serif;
    font-size: 2rem;
    line-height: 1;
    margin: 0;
    padding: 0;
	position: relative;
		/* bottom: 0.1rem; */
}

.header-content h1:lang(en) {
	font-family: var(--font-heading);
	/* transform: scaleY(2.5); */
	transform: scale(1.2, 2.5) translateX(10px);
}

sl-radio-button::part(button) {
	border: 1.5px solid var(--main-font-color);
	color: var(--main-font-color);
    font-family: var(--font-heading);
}

sl-radio-button::part(label) {
	font-size: 12px;
}

sl-radio-button::part(button) {
}

sl-radio-button::part(button):hover {
	color: white;
}

sl-radio-button::part(button--checked) {
	color: white;
}

@media screen and (max-width: 430px) {
	/* change header to look good on mobile */
}

nav {
    display: flex;
		align-items: flex-end;
    font-size: 1.1rem;
	margin-left: auto;
    text-align: center;
}

nav ul {
    font-family: var(--font-heading);
    display: inline-flex;
    /* margin: 0.5em 0; */
	margin: 0;
}

nav li {
    list-style: none;
/*    padding-top: 0.2em;*/
    align-content: center;
}

nav ul a, 
nav ul a:visited {
    display: inline-flex;
    color: inherit;
    text-decoration: none;
    margin: 0em 1em;
    border-bottom: 0.18em solid transparent;
}

nav ul a:hover {
    border-bottom: 0.18em solid #191b2d;
    border-radius: 0.18em;
}

/* start hamburger menu css*/
.hamburger-menu {
	cursor: pointer;
	height: 30px;
	margin-right: 16px;
	width: 30px;

	.line {
		stroke-width: 6;
		stroke-linecap: round;
		stroke: var(--main-font-color);
		transition: all 0.3s;
	}

	.top {
		transform-origin: 26px 40px;
	}

	.middle {
		stroke-dasharray: 60 60;
	}

	.bottom {
		transform-origin: 26px 60px;
	}
}

.hamburger-menu.open .top {
	transform: rotate(45deg);
}

.hamburger-menu.open .middle {
	stroke-dasharray: 1 60;
	stroke-dashoffset: -30;
}

.hamburger-menu.open .bottom {
	transform: rotate(-45deg);
}
/* end hamburger menu */

nav #contact-button {
	border-radius: 2em;
	outline: solid;
	outline-width: 2px;
	padding: 0 4px;
}

main {
	display: flex;
		flex-direction: column;
	height: 100%;
    /* padding-left: calc(2rem + 30px); */
	/* padding-right: calc(2rem + 30px); */
	overflow: visible;

	.main-container {
		display: flex;
			flex-direction: column;
			/* align-items: center; */
		@media (width < 1160px) {
			/* max-width: 700px; */
		}

		@media (width < 800px) {
			/* max-width: 350px; */
		}
	}

	.splash {
		display: inline-block;
		font-family: var(--font-heading);
		font-size: var(--splash);
		line-height: 1;
		margin: 0;
		margin-bottom: 1.2rem;
		/* position: relative; */
		/* 	right: 0.5em; */
	}

	.splash:lang(en) {
		line-height: 0.8;
	}

	h2 {
		margin: 0 0 0 2rem;
		font-family: var(--font-heading);
	}

	.p-container {
		margin-left: 2rem;
		margin-bottom: 1rem;
		width: 40rem;
	}

	p {
		font-family: var(--font-serif);
		margin: 0;
		/* margin-bottom: 1rem; */
		padding: 0;
	}

	p:lang(en) {
		font-weight: 200;
	}

	ul {
		margin: 0;
	}

	.showcase-container {
		display: flex;
			flex-direction: column;
			align-items: center;
	}

	.showcase {
		/* border: 2px solid red; */
		display: grid;
			grid-template-columns: 1fr 1fr;
			justify-items: stretch;

		@media (width <= 800px) {
			grid-template-columns: minmax(auto, 450px);
			justify-content: center;
		}
		
		.card {
			border: 2px solid black;
			border-radius: 1em;
			margin: 5px;
			padding: 0.5em 1.2em;

			h2 {
				margin: 0;
				margin-bottom: 0.2em;
			}

			p {
				margin: 0;
				margin-bottom: 0.4em;
				line-height: 1.2em;
			}
		}

		#your-idea-here {
			align-content: center;
			text-align: center;
		}
	}

	.faq-container {
		max-width: 750px;
	}

	sl-details {
		width: 100%;
	}

	sl-details::part(base) {
		background-color: inherit;
		border: none;
		/* border-bottom: 2px solid black; */
		border-radius: 0;
	}

	sl-details::part(summary) {
		font-family: var(--font-heading);
		font-size: 1.2rem;
	}

	sl-details.custom-icons::part(summary-icon) {
		rotate: none;
	}

	sl-details::part(content) {

	}
}

/* h2 + p { */
/*     border-left: 2px solid black; */
/*     font-size: 16px; */
/*     margin-left: 2em; */
/*     max-width: 50%; */
/*     padding-left: 1em; */
/* } */

sl-input::part(base) {
	/* background-color: inherit; */
	border: 2px solid var(--main-font-color);
	color: var(--main-font-color);
}

sl-textarea::part(base) {
	/* background-color: inherit; */
	border: 2px solid var(--main-font-color);
	color: var(--main-font-color);
}

form {
    border-radius: 0.5em;
    border: 2px solid var(--main-font-color);
    font-family: var(--font-heading);
    padding: 1em;
    max-width: 550px;
}

input, textarea {
    background-color: inherit;
    border: 2px solid #000;
    box-sizing: border-box;
}

textarea {
    resize: none;
}

.form-row {
	display: flex;
		align-items: center;
		flex-wrap: nowrap;
		gap: 0.8em;
}

.flip {
    display: inline-block;
    transform: scale(-1, 1);
}

footer {
    background: inherit;
	color: inherit;
    font-family: Helvetica, sans-serif, "CCsymbols"; 
    font-size: 0.55rem;
    padding-bottom: 1rem;
	padding-left: 1rem;
    padding-top: 3rem;
    text-align: left;
	z-index: 0; /* This is to ensure that the .flip class appears below other elements */
}

.i18n-line {
	display: block;
}

.i18n-break {
	display: block;
}

:lang(en) .i18n-break {
	height: 0.8rem;
}

:lang(ja) .i18n-break {
	height: 0.5rem;
}

:lang(zh) .i18n-break {
	height: 0.5rem;
}

strong {
	font-weight: bolder;
	text-decoration: underline;
}

strong:lang(en) {
	font-weight: 600;
}

/* Response design stuff here */

/* Mobile */
@media (width <= 575px) {
	:root {
		--drawer-width: 60vw;
	}

	.mobile-drawer * {
	}

	nav ul a {
		display: none;
	}

	main {
		.splash { /* * added because spans are generated by JS */
			/* font-size: 4.5rem; */
			position: relative;
				right: 0;
		}

		.p-container {
			width: 100%;
			margin-left: 1rem;
		}

		h2 {
			margin-left: 1rem;
		}

		ul {
			margin: 0;
			padding: 0;
			padding-left: 1rem;
		}
	}

	footer {
		text-align: center;
		padding-left: 0;
	}
}

@media (width <= 700px) {
	nav a:nth-child(-n+2) { /* first two elements */
		display: none;
	}

	nav .hamburger-menu {
		display: inline-block;
	}
}

@media (width <= 800px) {
	.main-grid {
		grid-template-columns: 
			minmax(5px, 0.5fr) 
			minmax(auto, 800px)
			minmax(5px, 0.5fr);
	}

	main {
		.main-container {
			/* padding: 0 clamp(5rem, 10vw, 10rem); */
		}

		.text-container {
			align-self: center;
			width: 90%;
			max-width: 35rem;
		}

		.p-container {
			flex: 1 1 0;
			margin: 0;
			max-width: 35rem;
		}

		h2 {
			margin-left: 0;
		}
	}
}

/* Tablet */
@media (width <= 905px) {
	nav a:nth-child(1) {
		display: none;
	}

	nav .hamburger-menu {
		display: inline-block;
	}
}

/* Desktop */
@media (width > 905px) {
	nav .hamburger-menu {
		display: none;
	}
}

[data-i18n], [data-i18n-summary], [data-i18n-label] {
	transition: opacity 0.2s ease;
}

.faq-container sl-details {
	scroll-margin-top: var(--header-height);
}
