/* --- Variables --- */
:root {
  --bg: rgb(235,235,235);
  --font: rgb(30,30,30);
  --font-btn: rgb(250,250,250);
  --tile-bg: rgb(245,245,245);
  --tile-top: rgb(250,250,250);
  --tile-bot: rgb(230,230,230);
  --tile-last-bg: rgb(235,235,235);
  --accent: rgb(245,90,25);
  --link-hover: rgb(40,70,190);
  --overlay-w: 92px;
  --overlay-h: 34px;
}
[data-theme="dark"] {
  --bg: rgb(30,30,30);
  --font: rgb(235,235,235);
  --tile-bg: rgb(20,20,20);
  --tile-top: rgb(40,40,40);
  --tile-bot: rgb(10,10,10);
  --tile-last-bg: rgb(30,30,30);
  --link-hover: rgb(40,170,70);
}
/* --- Variables END --- */
/* --- Settings --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* --- Settings END --- */
/* --- Dark mode animation --- */
@keyframes vt-reveal {
  from { clip-path: circle(0px at var(--vt-x, 50%) var(--vt-y, 0%)); }
  to   { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 0%)); }
}
::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) {
  animation: vt-reveal 500ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  mix-blend-mode: normal;
}
@media (prefers-reduced-motion: reduce) { ::view-transition-new(root) { animation-duration: 0.01s; } }
.vt-freeze, .vt-freeze * { transition: none !important; }
/* --- Dark mode animation END --- */
/* --- Header --- */
.header-tile .tile-main {height: 120px;}
.header-tile .header-body {
  padding: 0;
  height: 100%;
}
.header-tile .tile-body {
  padding: 0;
  height: 100%;
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "navleft logo headerright";
  align-items: center;
  height: 120px;
  column-gap: 20px;
}
.nav-left { grid-area: navleft; }
.logo { grid-area: logo; }
.header-right { grid-area: headerright; }
.header-inner .nav-left { justify-content: space-evenly; padding: 0; gap: 0; }
.header-right {
  display: flex;
  align-items: center;
  gap: 0;
  justify-content: flex-start;
}
.header-right .nav-right { flex: 1; justify-content: space-evenly; gap: 0; }
.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo img { display: none; height: auto; width: auto; }
.logo .logo-v { height: 100px; }
.logo .logo-v.logo-light { display: block; }
[data-theme="dark"] .logo .logo-v.logo-light { display: none; }
[data-theme="dark"] .logo .logo-v.logo-dark  { display: block; }
nav.main-nav {
  display: flex;
  gap: 30px;
  align-items: center;
}
nav.main-nav a {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(16px, calc((100vw - 800px) / 155 + 16px), 21px);
  color: var(--font);
  text-decoration: none;
  transition: color 0.15s;
  text-align: center;
}
nav.main-nav a:hover { color: var(--link-hover); }
nav.main-nav a.active { color: var(--accent); }
.nav-br { display: block; height: 0; overflow: hidden; }
/* --- Header END --- */
/* --- Tiles ---*/
body {
  background: var(--bg);
  color: var(--font);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  transition: background 0.35s ease, color 0.35s ease;
}
.site-wrap {
  width: max(calc(75vw + 167px), 90vw);
  max-width: 1440px;
  margin: 0 auto;
}
.header-body {
  position: relative;
  z-index: 1;
  padding: 15px;
}
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding-top: 15px;
  padding-bottom: 15px;
}
header::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 15px;
  background: linear-gradient(to bottom, var(--bg), transparent);
  pointer-events: none;
  opacity: 0;
}
header.is-stuck::after {
  opacity: 1;
  transition: opacity 0.2s ease;
}
header.nav-scrolling::after {
  opacity: 0 !important;
  transition: none !important;
}
section {
  scroll-margin-top: 150px;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}
.tile-main {
  background: var(--tile-bg);
  clip-path: polygon(25px 0%, calc(100% - 25px) 0%, 100% 25px, 100% calc(100% - 25px), calc(100% - 25px) 100%, 25px 100%, 0% calc(100% - 25px), 0% 25px);
  position: relative;
  overflow: hidden;
  container-type: inline-size;
}
.tile-line-top {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 25px;
  background: var(--tile-top);
  clip-path: polygon(0px 25px, 25px 0px, calc(100% - 25px) 0px, 100% 25px, calc(100% - 25px) 5px, 25px 5px);
  pointer-events: none;
}
.tile-line-bot {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 25px;
  background: var(--tile-bot);
  clip-path: polygon(0px 0px, 25px 25px, calc(100% - 25px) 25px, 100% 0px, calc(100% - 25px) 20px, 25px 20px);
  pointer-events: none;
}
.last .tile-main { background: var(--tile-last-bg); }
.tile-body {
  position: relative;
  z-index: 1;
  padding: 15px;
  display: flex;         
  flex-direction: column;
  height: 100%;
}
.tile-row { display: flex; gap: 15px 20px; margin-bottom: 15px; }
.tile-wrap { flex: 1 1 0; }
.tile-title-central {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 3.5vw, 26px);
  align-items: center;
  text-align: center;
  width: 100%;
  margin-bottom: 0px;
}
h2.tile-title-central { font-size: clamp(16px, 3vw, 26px); }
/* --- Tiles END --- */
/* --- Buttons --- */
.btn-primary, .btn-secondary {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  padding: 12px 28px; 
  cursor: pointer;
  clip-path: polygon(6px 0%, calc(100% - 6px) 0%, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0% calc(100% - 6px), 0% 6px);
  white-space: normal;
  transition: opacity 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%; 
  border: none;
  box-sizing: border-box;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--font-btn);}
.btn-secondary { background: var(--font); color: var(--bg);}
@keyframes flashOpacity {
  0% { opacity: 1; }
  10% { opacity: 0.75; }
  25% { opacity: 0.75; }
  100% { opacity: 1; }
}
.btn-primary:hover, .btn-secondary:hover { animation: flashOpacity 1s ease-in-out forwards; }
#go-top-btn {
  position: fixed;
  width: 50px;
  height: 75px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 90;
  right: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#go-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
#go-top-btn img { width: 50px; height: auto; display: block; pointer-events: none; }
#go-top-btn.visible:hover {
  animation: flashOpacity 0.5s ease-in-out forwards !important;
  cursor: pointer;
}
#go-top-btn .goto-light { display: block; }
#go-top-btn .goto-dark  { display: none; }
[data-theme="dark"] #go-top-btn .goto-light { display: none; }
[data-theme="dark"] #go-top-btn .goto-dark  { display: block; }
.dark-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 30px 0 0;
}
.dark-btn img { height: 55px; width: auto; display: none; }
.dark-btn .btn-light-default { display: block; }
.dark-btn:not(.just-clicked):hover .btn-light-default { display: none; }
.dark-btn:not(.just-clicked):hover .btn-light-hover { display: block; }
[data-theme="dark"] .dark-btn .btn-light-default { display: none; }
[data-theme="dark"] .dark-btn .btn-dark-default { display: block; }
[data-theme="dark"] .dark-btn:not(.just-clicked):hover .btn-dark-default { display: none; }
[data-theme="dark"] .dark-btn:not(.just-clicked):hover .btn-light-hover { display: none; }
[data-theme="dark"] .dark-btn:not(.just-clicked):hover .btn-dark-hover { display: block; }
.btn-primary:focus-visible, .btn-secondary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.btn-primary:focus-visible { box-shadow: inset 0 0 0 2px var(--bg); }
.btn-secondary:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
/* --- Buttons END --- */
/* --- Contact details --- */
.contact-detail { margin-bottom: 10px; font-family: 'Inter', sans-serif; font-size: 16px; }
.contact-detail a { color: var(--font); text-decoration: underline; }
.contact-detail a:hover { color: var(--link-hover); }
/* --- Contact details END --- */
/* --- Footer --- */
footer {
  position: relative;
  z-index: 10;
}
.footer-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 15px !important;
}
.footer-col, .footer-col-center, .footer-col-right {
  text-align: center;
  flex: none;
  width: 100%;
  min-width: 0;
}
.footer-link {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--font);
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.15s, color 0.15s;
  white-space: nowrap;
}
.footer-link:hover { opacity: 1; color: var(--link-hover); }
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 5px 5%;
  width: 100%;
  padding: 0 30px 0 30px;
}
.footer-meta > * {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: var(--font);
  opacity: 0.5;
  white-space: nowrap;
}
.footer-meta a, .footer-meta button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, color 0.15s;
}
.footer-dev {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    opacity: 0.5;
}
.footer-dev a { color: var(--font); text-decoration: none; transition: opacity 0.15s; }
.footer-dev a:hover { opacity: 0.7; }
.arigato-logo { height: 14px; width: auto; vertical-align: middle; display: none; }
.arigato-logo-light { display: inline; }
[data-theme="dark"] .arigato-logo-light { display: none; }
[data-theme="dark"] .arigato-logo-dark  { display: inline; }
/* --- Footer END--- */
/* --- Media --- */
@media (width >= 1200px) {
  nav.main-nav a { font-size: 21px; }
}
@media (width < 1200px) {
  .site-wrap { padding-left: 10px; padding-right: 10px; }
  .header-tile .tile-main { height: 80px; }
  .header-inner {
    display: flex;
    justify-content: flex-start;
    align-items: center;
  }
  .nav-left { display: none; }
  .logo { padding: 0 0 0 30px; justify-content: flex-start; align-self: stretch; }
  .header-right { margin-left: auto; gap: 20px; align-self: stretch; align-items: stretch; }
  .dark-btn { align-self: stretch; }
  .logo .logo-v { display: none !important; }
  .logo .logo-h { height: 60px; }
  .logo .logo-h.logo-light { display: block; }
  [data-theme="dark"] .logo .logo-h.logo-light { display: none; }
  [data-theme="dark"] .logo .logo-h.logo-dark  { display: block; }
  .dark-btn img { height: 55px; }
  nav.main-nav a { white-space: normal; text-align: center; line-height: 2.5vh; }
  section { scroll-margin-top: 110px; }
}
@media (800px <= width < 1200px) {
  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .header-inner .nav-left { display: contents; }
  .header-right { display: contents; }
  .header-right .nav-right { display: contents; }
  .logo { align-self: center; justify-content: center; }
  .dark-btn { align-self: center; }
  .dark-btn img { height: 55px; }
}
@media (width < 800px) { 
  nav.main-nav { display: none; }
  .site-wrap { width: calc(100vw - 20px); }
  .tile-row { flex-direction: column; }
  .tile-wrap { width: 100%; flex: 1 1 100%; }
  .header-inner { justify-content: space-between; }
  .header-right { margin-left: 0; }
  .dark-btn img { height: 55px; }
}
@media (width < 700px) {
  .contact-label { margin-bottom: 2px !important; }
  a { word-break: break-all; overflow-wrap: break-word; }
}
@media (max-height: 500px) {
  body { line-height: 4.5vh; }
}
@media (hover: hover) {.footer-meta a:hover, .footer-meta button:hover { opacity: 1; color: var(--link-hover); } }
/* --- Media END --- */
