@font-face {
  font-family: "Commissioner";
  src: url("/fonts/Commissioner-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: optional;
}
@font-face {
  font-family: "Commissioner";
  src: url("/fonts/Commissioner-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: optional;
}
@font-face {
  font-family: "Commissioner";
  src: url("/fonts/Commissioner-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600 900;
  font-display: optional;
}
@font-face {
  font-family: "Kalnia";
  src: url("/fonts/Kalnia.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: optional;
}
:root {
  color-scheme: dark;
  --coffee: #241710;
  --panel: #322219;
  --raised: #402c22;
  --gold: #dfb978;
  --ivory: #f5e6cd;
  --muted: #c8af92;
  --line: #856444;
  font-family:
    "Commissioner",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  color: var(--ivory);
  background: var(--coffee);
  font-size: 19px;
  line-height: 1.6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background-image: url("/grain.svg");
  min-height: 100vh;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  border: 1px solid #86644555;
  margin: 9px;
  z-index: -1;
}
main {
  max-width: 740px;
  margin: auto;
  padding: 26px 26px 64px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 30px;
}
.brand {
  font-family: "Kalnia", Georgia, serif;
  font-weight: 500;
  letter-spacing: -2px;
  font-size: 46px;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 13px;
}
.brand img {
  width: 36px;
  height: 36px;
  margin: 0;
}
.tag {
  font-size: 12px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--gold);
}
h1,
h2 {
  font-family: "Kalnia", Georgia, serif;
  font-weight: 500;
  color: var(--ivory);
}
h1 {
  font-size: clamp(36px, 7vw, 52px);
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin: 15px 0 22px;
  white-space: pre-line;
}
h2 {
  font-size: 30px;
  line-height: 1.25;
  margin: 9px 0 15px;
}
p {
  margin: 10px 0 20px;
}
.muted {
  color: var(--muted);
}
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 12px 8px;
}
.hero > div {
  max-width: 470px;
}
.hero img {
  width: 270px;
  max-width: 100%;
  order: -1;
  margin: -15px 0 20px;
}
.hero p {
  max-width: 430px;
  margin: 0 auto 16px;
}
.card {
  position: relative;
  background: var(--panel) url("/grain.svg");
  border: 1px solid var(--line);
  border-radius: 28px 28px 12px 12px;
  padding: 28px;
  margin: 26px 0;
  box-shadow: 0 10px 35px #120c0733;
}
.stitched:before,
.stitched:after {
  content: "";
  position: absolute;
  top: -11px;
  width: 22px;
  height: 22px;
  background: var(--coffee) url("/kolam.svg") center/contain no-repeat;
}
.stitched:before {
  left: 24px;
}
.stitched:after {
  right: 24px;
}
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.row > * {
  flex: 1;
}
button,
input,
select {
  font: inherit;
  border-radius: 12px;
  min-height: 60px;
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--ivory);
}
button {
  cursor: pointer;
  font-weight: 650;
  transition: background 0.15s;
}
button:hover:not(:disabled) {
  background: #53392a;
}
button.primary {
  background: var(--gold);
  color: #2b1a12;
  border: 1px solid #f3d397;
  box-shadow:
    inset 0 0 0 4px #dfb978,
    inset 0 0 0 5px #8b663b;
  font-weight: 750;
}
button.primary:hover:not(:disabled) {
  background: #efd09a;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}
button.secondary {
  background: #3a2b22;
}
button.danger {
  background: #9a4738;
  color: #fff1df;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #f6dca9;
  outline-offset: 4px;
}
.small {
  font-size: 16px;
}
.badge {
  border-block: 1px solid var(--line);
  padding: 12px 4px;
  font-size: 17px;
  color: var(--gold);
  text-align: center;
  display: block;
  letter-spacing: 0.3px;
}
.tamil {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 34px;
  line-height: 1.75;
  color: #f5dfb8;
}
.roman {
  font-family: "Commissioner", sans-serif;
  font-size: 28px;
  font-weight: 500;
}
.phrase {
  text-align: center;
  padding: 36px 16px;
  border-radius: 70px 70px 14px 14px;
}
.phrase:before {
  left: calc(50% - 11px);
}
.phrase:after {
  display: none;
}
audio {
  width: 100%;
  margin: 12px 0;
}
.notice {
  padding: 18px;
  border-radius: 12px;
  background: #374032;
  color: #e5ebd1;
  border: 1px solid #798462;
  min-height: 56px;
}
.error {
  background: #502a24;
  color: #ffddc8;
  border-color: #b87b62;
}
label {
  display: block;
  font-weight: 650;
  margin: 20px 0 10px;
}
.lesson {
  display: block;
  text-align: left;
  margin: 14px 0;
  background: #38271e;
  border-color: #6b5038;
  padding: 19px 18px;
  border-radius: 12px;
  font-size: 20px;
}
.lesson span {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
}
.login {
  max-width: 540px;
  margin: 10px auto;
}
.login > .brand {
  justify-content: center;
  margin-bottom: 16px;
}
.login .card {
  padding: 28px;
  margin-top: 12px;
}
.login .garden {
  width: 260px;
  max-width: 100%;
  display: block;
  margin: -8px auto 12px;
}
.login .tag,
.login h1,
.login .intro-copy {
  text-align: center;
}
.login h1 {
  font-size: 38px;
}
.login .intro-copy {
  font-size: 18px;
  color: var(--muted);
}
.login .small {
  font-size: 16px;
}
a {
  color: var(--gold);
}
progress {
  width: 100%;
  accent-color: var(--gold);
  height: 7px;
  display: block;
  margin: 23px 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
}
progress::-webkit-progress-bar {
  background: #59402e;
}
progress::-webkit-progress-value {
  background: var(--gold);
}
nav {
  margin: 25px 0;
}
footer {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: Georgia, serif;
  font-style: italic;
}
#preview {
  background: #483322;
  border: 1px solid #d9b575;
}
#status:empty {
  display: none;
}
@media (min-width: 700px) {
  .hero {
    display: grid;
    grid-template-columns: 1fr 260px;
    text-align: left;
    gap: 25px;
  }
  .hero img {
    order: 0;
    margin: 0;
    width: 260px;
  }
  .hero h1 {
    font-size: 48px;
  }
}
@media (max-width: 430px) {
  main {
    padding: 20px 22px 50px;
  }
  header .tag {
    font-size: 10px;
    letter-spacing: 1.5px;
  }
  .card {
    padding: 24px 20px;
  }
  .row {
    gap: 9px;
  }
  .row button {
    padding: 14px 8px;
  }
  .tamil {
    font-size: 30px;
  }
  .hero img {
    width: 230px;
  }
  .hero {
    padding-inline: 0;
  }
  .login .card {
    padding: 24px 20px;
  }
  .login .garden {
    width: 220px;
  }
  .login h1 {
    font-size: 35px;
  }
}

/* Keep touch scrolling, without mobile scroll indicators. */
@media (hover: none) and (pointer: coarse), (max-width: 600px) {
  * {
    scrollbar-width: none;
  }
  *::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
}

/* Status changes never insert rows or move the recording controls. */
[hidden] {
  display: none !important;
}
.hero img,
.login .garden {
  height: auto;
  aspect-ratio: 400 / 350;
}
html {
  scrollbar-gutter: stable;
}
.recording-studio h2 {
  font-size: 24px;
  margin: 0 0 12px;
}
.saved-slot {
  margin-bottom: 28px;
}
.take-slot {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 16px;
}
.take-slot h2 {
  min-height: 2.5em;
}
.recording-studio audio,
.audio-placeholder {
  display: block;
  width: 100%;
  height: 54px;
  margin: 12px 0 20px;
}
.audio-placeholder {
  display: flex;
  align-items: center;
  font-size: 17px;
}
.take-actions {
  margin-top: 12px;
  align-items: stretch;
}
.take-actions button {
  min-height: 90px;
}
#status-wrap {
  position: fixed;
  inset: max(12px, env(safe-area-inset-top)) 16px auto;
  max-width: 680px;
  margin-inline: auto;
  z-index: 10;
  box-shadow: 0 8px 35px #120c0780;
}
#status-wrap .notice {
  margin: 0;
  padding-right: 58px;
  max-height: 25vh;
  overflow-y: auto;
}
#dismiss-status {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
}
.login #status {
  min-height: 3.2em;
  margin: 14px 0 0;
  color: #ffddc8;
}
.login #status:empty {
  display: block;
  visibility: hidden;
}

[data-role="record"] {
  min-height: calc(2lh + 32px);
}
