:root {
  --background-body: #fff;
  --text-main: #36393b;
  --text-secondary: #6b6f72;
  --primary-color: #548e9b;
  --font-family-serif: Merriweather, serif;
  --font-family-sans: 'Fira Sans', sans-serif;
}

:root.theme-dark {
  --background-body: #202122;
  --text-main: #fff;
  --text-secondary: #ccc;
  --primary-color: #548e9b;
}

html {
  overflow-y: scroll;
}

@supports (scrollbar-gutter: stable) {
  html {
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
}

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

body {
  margin: 0;
  font-family: "Roboto, Arial, sans-serif";
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--background-body);
  color: var(--text-main);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Roboto, Arial, sans-serif";
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em 0;
}

h1 {
  font-family: "Roboto, Arial, sans-serif";
  font-size: 4em;
  margin: 0 0 1em 0;
}

h2 h1 {
  font-size: 3em;
}

h3 { font-size: 1.5em; }
h4 { font-size: 1.4em; }
h5 { font-size: 1.3em; }
h6 { font-size: 1.2em; }

p,
ul,
ol {
  font-size: 1.3rem;
  line-height: 1.75em;
  margin: 1.2em 0;
}

ol,
ul {
  padding-left: 1.2em;
}

li {
  margin: 1rem 0;
}

li p {
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
}

a {
  color: inherit;
  transition: color linear 0.15s;
}

a:hover {
  color: var(--primary-color);
}

p a {
  text-decoration: none;
  box-shadow: inset 0 -0.12em 0 var(--primary-color);
  transition: box-shadow 0.2s ease-in-out, color 0.2s ease-in-out;
}

p a:hover {
  box-shadow: inset 0 -1.5em 0 var(--primary-color);
  color: #fff;
}

img {
  max-width: 100%;
  height: auto;
}

hr {
  padding: 0;
  border: 0;
  height: 1px;
  margin: 40px auto;
  background-color: var(--text-secondary);
}

code {
  font-family: 'SF Mono', menlo, inconsolata, monospace;
  font-size: calc(1em - 2px);
  color: #555;
  padding: 0.2em 0.4em;
  border-radius: 2px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

pre {
  border-radius: 8px !important;
  margin: 1.2em 0 !important;
  padding: 1.2em;
}

pre code {
  padding: 0;
}

blockquote {
  border-left: 4px solid #cccccc;
  font-size: 1.4em;
  font-style: italic;
  margin: 2rem 0;
  padding-left: 2rem;
  padding-right: 2rem;
}

blockquote p {
  padding-bottom: 6px;
}

blockquote footer {
  font-size: 1.1rem;
  text-align: right;
}

figure {
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  -webkit-margin-start: 0;
  -webkit-margin-end: 0;
  margin: 0 0 3em 0;
}

table {
  border-collapse: collapse;
  font-family: "Roboto, Arial, sans-serif";
  font-size: 1.125em;
  margin: 2em 0;
}

th {
  border-bottom: 2px solid #cccccc;
  padding: 0.4em 0.8em;
  word-break: break-word;
}

td {
  padding: 0.4em 0.8em;
  word-break: break-word;
}

.container {
  margin: 0 auto;
  max-width: 42em;
  width: 100%;
}

.content h1 {
  font-size: 3em;
  margin: 1em 0;
}

.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  position: relative;
  margin: 0 auto;
  max-width: 1400px;
  padding: 1em 2em;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
}

@media screen and (max-width: 800px) {
  main {
    margin: 0 0 0 0;
    padding: 0 0 0 0;
  }
  .theme-toggle-container {
    margin-right: 1em;
  }
  .logo img {
    display: none;
  }
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--background-body);
  display: flex;
  margin: 0 auto;
  max-width: 1400px;
  padding: 0.2em 2em;
  width: 100%;
}

.logo img {
  display: block;
  width: 75px;
}

nav {
  align-items: center;
  display: flex;
  flex: 1;
  font-family: "Roboto, Arial, sans-serif";
  font-weight: 700;
  justify-content: flex-end;
  text-transform: uppercase;
}

nav a {
  color: inherit;
  text-decoration: none;
  padding: 10px 5px;
  display: block;
  position: relative;
  margin-left: 20px;
  min-width: 70px;
  text-align: center;
}

nav a:not(.selected) {
  opacity: 0.7;
}

nav a::before {
  content: '';
  position: absolute;
  transition: transform .3s ease;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--text-secondary);
  transform: scaleX(0);
}

nav a:hover::before,
nav .selected::before {
  transform: scaleX(1);
}

nav .selected::before {
  background: var(--primary-color);
}

.theme-toggle-container {
  width: 75px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0.33em 0.67em;
  padding-top: 8px;
  margin-left: 10px;
  gap: 0.6em;
  border-radius: 99em;
}

.theme-toggle > label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  cursor: pointer;
}

.theme-toggle > label:focus-within {
  outline: 2px solid transparent;
}

.theme-toggle .checked {
  opacity: 1;
}

input[name='theme-toggle'] {
  position: absolute;
  opacity: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
}

footer {
  position: sticky;
  bottom: 0;
  z-index: 100;
  background-color: var(--background-body);
  padding: 0.2em 1em;
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1em;
  margin-top: 1em;
}

.social-links a {
  text-decoration: none;
}

.home-container {
  display: flex;
  flex: 1;
  justify-content: flex-start;
  margin: 2em 0;
  min-height: 400px;
}

.home-copy {
  flex: 1;
  padding: 0 1em;
}

.home-copy h1 {
  font-weight: 700;
  margin: 0;
  padding: 0;
  line-height: 2;
  font-size: 1.3em;
  color: orange;
}

.nav-title {
  font-weight: 700;
  margin: 0;
  padding: 0;
  line-height: 2;
  font-size: 1.3em;
  color: var(--text-main);
}

.home-copy h2 {
  font-weight: 700;
  margin: 0;
  padding: 0;
  line-height: 2;
  font-size: 1.1em;
  color: orange;
}

.home-copy p {
  font-size: 1.0em;
}

.home-copy ul {
  font-size: 1.0em;
  margin: 0;
}

.home-copy ol {
  font-size: 1.0em;
  margin: 0;
}

.home-copy li {
  font-size: 1.0em;
  margin: 0;
}

.home-copy a {
  font-size: 1.0em;
  color: dodgerblue;
}

.akiame-image-container {
  margin: 0 1em;
  text-align: center;
}

.akiame-image-container picture {
  display: block;
  min-height: 250px;
}

.akiame-image {
  width: 100%;
  max-width: 550px;
  margin-bottom: 1em;
}

@media (max-width: 1200px) {
  .akiame-image {
    max-width: 400px;
  }
}

@media (max-width: 800px) {
  .home-container {
    flex-direction: column;
  }

  .home-copy {
    flex: 0;
    padding-bottom: 2em;
    text-align: left;
  }
}

.google-embed {
  width: 100%;
  height: 500px;
  border: 0;
}

.about-image {
  float: right;
  margin: -3em -7em 2em 2em;
  max-width: 300px;
}

.about-image img {
  border-radius: 8px;
  margin-bottom: 1.5em;
}

@media (max-width: 1020px) {
  h1 {
    font-size: 3em;
  }

  .content h1 {
    font-size: 2.4em;
  }

  .about-image {
    float: none;
    margin: 0 auto 2em;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  p,
  ul,
  ol {
    font-size: 1.2rem;
    margin: 1em 0;
  }
}

/* Lightbox */
.gallery-item img {
  cursor: pointer;
}

#lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  gap: 1em;
  padding: 1em;
}

#lb-overlay.lb-open {
  display: flex;
}

#lb-img-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

#lb-img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 6px;
  object-fit: contain;
  display: block;
}

#lb-prev,
#lb-next {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 2.5em;
  line-height: 1;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  transition: background 0.2s;
  flex-shrink: 0;
  user-select: none;
}

#lb-prev:hover,
#lb-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

#lb-close {
  position: absolute;
  top: 0.75em;
  right: 0.75em;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.5em;
  line-height: 1;
  padding: 0.25em 0.5em;
  border-radius: 4px;
  transition: background 0.2s;
}

#lb-close:hover {
  background: rgba(255, 255, 255, 0.3);
}
